Recent

Author Topic: Weird Behaviour in Keymapping for uncommenting a block  (Read 324 times)

Zvoni

  • Full Member
  • ***
  • Posts: 140
Weird Behaviour in Keymapping for uncommenting a block
« on: March 10, 2019, 06:13:03 pm »
Hi Folks,

Ubuntu18.10-64Bit/FPC304/Laz200 with QT5

The standard shortcut for uncommenting a selected block of comments (CTRL+SHIFT+U) shows strange behaviour.

I select a block of consecutive comments (comments with "//"), i press CTRL+SHIFT+U, nothing happens, i move the mouse to the menu, and the moment i click on the "Source-Code"-Menu my selected block of comments is deleted (!!) and a lowercase "u" is inserted instead.

I checked the Keymappings in Tools - Options: there are no conflicts
I even deleted the shortcut for that from the mappings (correctly shown in the menu that there is no shortcut), saved everything, closed Lazarus, started again,
defined the shortcut again (via Key-Trap): no change.

Bug or feature?  :D :D :D

EDIT: Huh?????
Just for grins i changed the shortcut to CTRL+SHIFT+A (no conflicts), and it works as intended - uncomments a block
changed it back to CTRL+SHIFT+U, and i'm back at square one.
There is some black voodoo going on.... Lazarus doesn't seem to like my "u"-key..... :'( :'( :'( :'(
« Last Edit: March 10, 2019, 06:16:24 pm by Zvoni »
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie

Blaazen

  • Hero Member
  • *****
  • Posts: 2770
  • POKE 54296,15
    • Eye-Candy Controls
Re: Weird Behaviour in Keymapping for uncommenting a block
« Reply #1 on: March 10, 2019, 06:28:57 pm »
OK, Ctrl+Shift+U has no conflict in Lazarus, but isn't there any conflict in your system or desktop environment?

Example: Ctrl+F4 doesn't work for me, because it switches to the fourth virtual desktop.
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Zvoni

  • Full Member
  • ***
  • Posts: 140
Re: Weird Behaviour in Keymapping for uncommenting a block
« Reply #2 on: March 10, 2019, 06:52:41 pm »
OK, Ctrl+Shift+U has no conflict in Lazarus, but isn't there any conflict in your system or desktop environment?

Example: Ctrl+F4 doesn't work for me, because it switches to the fourth virtual desktop.
Good idea.
Not that i can see a reaction (just closed everything and pressed CTRL+SHIFT+U --> nothing happend).
The reason why it's weird for me is, that with the GTK2-Interface of Lazarus it was working normally (yes, i haven't compiled Lazarus back to GTK2 just to test it).
I've switched to CTRL+SHIFT+A and it's doing what it's supposed to do

EDIT: Another reason, why i don't think having a systemwide conflict with that shortcut is, because the Key-trapping in Tools-Options works.
I activate Key-trap (on everything unchecked/unknown), press CTRL+SHIFT+U, and the combination appears correctly in the dialogue
« Last Edit: March 10, 2019, 06:56:26 pm by Zvoni »
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5169
    • wiki
Re: Weird Behaviour in Keymapping for uncommenting a block
« Reply #3 on: March 10, 2019, 10:36:45 pm »
Compile the IDE with VerboseKeys
then run it from a terminal, and watch the output.

You should see when and which key it receives. (at least for the editor)



Zvoni

  • Full Member
  • ***
  • Posts: 140
Re: Weird Behaviour in Keymapping for uncommenting a block
« Reply #4 on: March 12, 2019, 12:09:59 pm »
Compile the IDE with VerboseKeys
then run it from a terminal, and watch the output.

You should see when and which key it receives. (at least for the editor)

Recompiled IDE with VerboseKeys and used "startlazarus" from terminal.
Result for CTRL+SHIFT+U
I see the KeyDown for CTRL --> 17
I see the keyDown for SHIFT --> 16
Now it gets weird: I see a KeyUp (!!) for "U" --> fires a UTF8Pressed (or something. My Linux-Laptop is at home right now)

Result for CTRL+SHIFT+A
I see the KeyDown for CTRL --> 17
I see the keyDown for SHIFT --> 16
I see the KeyDown for "A" --> everything OK

EDIT: Before someone complains, that my "u"-key might be broken:
a regular "u"-press results in all correct ways (KeyDown, KeyUp, Fire UTF8Something, write in Editor)
« Last Edit: March 12, 2019, 04:19:37 pm by Zvoni »
One System to rule them all, One IDE to find them,
One Code to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie