View Issue Details

IDProjectCategoryView StatusLast Update
0025085LazarusIDEpublic2014-06-14 15:13
ReporterDenis Golovan Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinux 32bit 
Product Version1.1 (SVN) 
Summary0025085: [Regression] Multi-stage shortcuts stopped working
DescriptionHi

I've updated recently to Lazarus svn rev.42909 and found out that multi-staged (I don't know the proper naming for them) shortcuts stopped working.

I mean my "Ctrl+X, Ctrl+S" emacs-like shortcut skips Ctrl+X entirely and Lazarus sees only Ctrl+S.

Please fix this regression.
TagsNo tags attached.
Fixed in Revisionr43351
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0024008 resolvedJuha Manninen problem with CTRL key in two-key shortcut 

Activities

Juha Manninen

2013-09-25 21:33

developer   ~0070328

Last edited: 2013-09-25 21:35

View 2 revisions

Works well here.
Make sure you have the keys mapped. Maybe you changed the keymapping scheme. The default scheme has only few "multi-stage" mappings, Classic scheme has many of them. There is no Emacs scheme at all. Maybe you saw a dream about an Emacs scheme. :)

BTW, if you or somebody wants to contribute an Emacs keymapping scheme, that would be nice.

Denis Golovan

2013-09-25 21:36

reporter   ~0070329

I am quite sure they don't work.

I've created Ctrl+X then Ctrl+S shortcut for saving current file manually long ago. Of course, I don't use any default/predefined schemes for that.

Now main submenu "File" shows Ctrl+X,Ctrl+S shortcut as being defined for Save, but pressing Ctrl+X then Ctrl+S does not work.

Juha Manninen

2013-10-01 15:42

developer   ~0070469

Ok, defining Ctrl also with the second part still has an issue.
The logic was changed some time ago so that the second part works with and without Ctrl when the first part is defined with Ctrl and second part without it.
This is standard with the old WordStar compliant editors.

I remember I tested also this Ctrl+X,Ctrl+S style and it worked. I try to find time to see what happened. Or maybe you can look at the relevant code.(?) I will make a relation to the original issue.

Denis Golovan

2013-10-27 18:44

reporter   ~0070999

Reverting rev. 41140 allows to get Ctrl+X,Ctrl+S working again.
Please investigate.

Juha Manninen

2013-10-27 23:27

developer   ~0071004

The logic was moved away from SynEdit. The relevant code is now in unit KeyMapping, functions ShiftConflict and SetKeyCombo (below).
Maybe you have time to debug and fix it. If you do, please upload a patch. Otherwise I will debug it later.

---

  function ShiftConflict(aKey: TSynEditKeyStroke): Boolean;
  // This is called when first part of combo has Ctrl and 2nd part has Ctrl or nothing.
  // Check if ignoring Ctrl in second part would create a conflict.
  var
    ConflictShift: TShiftState;
    x: integer;
  begin
    Result := False;
    if aKey.Shift2 = [ssCtrl] then
      ConflictShift := []
    else
      ConflictShift := [ssCtrl];
    for x := 0 to ASynEditKeyStrokes.Count-1 do
      with ASynEditKeyStrokes.Items[x] do
        if (Key2 = aKey.Key2) and (Key = aKey.Key)
        and (Shift2 = ConflictShift) and (Shift = aKey.Shift) then
          Exit(True); // Found
  end;

  procedure SetKeyCombo(aKey: TSynEditKeyStroke; aShortcut: PIDEShortCut);
  // Define a key for a command
  begin
    aKey.Key :=aShortcut^.Key1;
    aKey.Shift :=aShortcut^.Shift1;
    aKey.Key2 :=aShortcut^.Key2;
    aKey.Shift2:=aShortcut^.Shift2;
    // Ignore the second Ctrl key in sequential combos.
    // For example "Ctrl-X, Y" and "Ctrl-X, Ctrl-Y" are then treated the same.
    if (aKey.Key2<>VK_UNKNOWN) and (aKey.Shift=[ssCtrl]) and (aKey.Shift2-[ssCtrl]=[])
    and not ShiftConflict(aKey) then
      aKey.ShiftMask2:=[ssCtrl]
    else
      aKey.ShiftMask2:=[];
  end;

Juha Manninen

2013-11-02 11:04

developer   ~0071098

Please test and close if OK.

Denis Golovan

2014-06-14 15:13

reporter   ~0075684

Fixed. Thanks

Issue History

Date Modified Username Field Change
2013-09-25 20:46 Denis Golovan New Issue
2013-09-25 21:33 Juha Manninen LazTarget => -
2013-09-25 21:33 Juha Manninen Note Added: 0070328
2013-09-25 21:33 Juha Manninen Assigned To => Juha Manninen
2013-09-25 21:33 Juha Manninen Status new => feedback
2013-09-25 21:35 Juha Manninen Note Edited: 0070328 View Revisions
2013-09-25 21:36 Denis Golovan Note Added: 0070329
2013-09-25 21:36 Denis Golovan Status feedback => assigned
2013-10-01 15:42 Juha Manninen Note Added: 0070469
2013-10-01 16:09 Juha Manninen Relationship added related to 0024008
2013-10-27 18:44 Denis Golovan Note Added: 0070999
2013-10-27 23:27 Juha Manninen Note Added: 0071004
2013-11-02 11:04 Juha Manninen Fixed in Revision => r43351
2013-11-02 11:04 Juha Manninen Note Added: 0071098
2013-11-02 11:04 Juha Manninen Status assigned => resolved
2013-11-02 11:04 Juha Manninen Resolution open => fixed
2014-06-14 15:13 Denis Golovan Note Added: 0075684
2014-06-14 15:13 Denis Golovan Status resolved => closed