Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-05

Insufficient keyboard modifiers support in IDE

10 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I'm using an Ergodox keyboard, and have a shortcut layer setup in my keyboard layout. This allows me a single key press, yet sends a complex key sequence to the OS. The same can be achieved with normal keyboards and some extra software.

This is extremely useful, and more about that can be read here, with an example setup under OSX.

Using the "Hyper" or "Meh" key plus one other key.

Hyper = Alt + Ctrl + Shift + Cmd/Win
Meh = Alt + Ctrl + Shift

all that via a single keypress.

* A Hyper key, as described by Brett Terpstra.
http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/

* A Meh key, which is a less-hyper version of the Hyper key (sends Alt+Ctrl+Shift, without Cmd/Win).

So in my fpGUI events test program, if I press one of those shortcut keys, the following sequence is registered:

[Shift Alt Ctrl Super] Key pressed: U
[Shift Alt Ctrl Super] Key released: U

Now in Lazarus IDE, I'm trying to customise some of my frequently used actions using such shortcut keys, but the IDE keyboard shortcut interface dialog, doesn't support the Super (aka Hyper) key modifier. It only supports Shift, Ctrl and Alt (Ergodox equivalent of the Meh key).

Could the IDE key-grab dialog be extended to support the Super (aka Hyper) modifier key as well, or is there some platform limitation, and why it isn't there?

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Graeme Geldenhuys
to Alexey
Alexey wrote
Hm, on OSX, IDE shows key grab dialog [in keymapping opts] with additional checkbox, "Meta". It is what yo need?

Attached is a screenshot of what I see. Both in Lazarus v1.7 and v1.9 using the IDE compiled with LCL-GTK2.

Note that there is checkboxes for "Shift", "Alt" and "Ctrl", but not for "Super" (aka Hyper on some systems, or Windows key, or Meta under KDE Plasma etc).

These are the possible modifiers I have available for X11 based systems. I presume other operating systems have similar.

   // modifier keys
   keyShift		= $e300;
   keyCtrl		  = $e301;
   keyAlt		  = $e302;
   keyMeta		  = $e303;
   keySuper		= $e304;
   keyHyper		= $e305;
   keyAltGr		= $e306;
   keyCaps		  = $e307;
   keyNum		  = $e308;
   keyScroll		= $e309;

Wikipedia: Super key (keyboard button)
https://en.wikipedia.org/wiki/Super_key_(keyboard_button)

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot.png Type: image/png Size: 6689 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170511/3bd214bf/attachment.png>

Reply by email

Alexey
to Graeme Geldenhuys
Both in Lazarus v1.7 and v1.9 using the IDE compiled with LCL-GTK2.

Check "Meta" shows on Mac only; you need it for Lin/Win? It is simple fix, one liner.

function TCustomShortCutGrabBox.GetDefaultShiftButtons: TShiftState;
begin
   {$IFDEF Darwin}
   Result:=[ssCtrl,ssShift,ssAlt,ssMeta];
   {$ELSE}
   Result:=[ssCtrl,ssShift,ssAlt];
   {$ENDIF}
end;
Regards, Alexey

Reply by email

Graeme Geldenhuys
to Alexey
Alexey wrote
Check "Meta" shows on Mac only; you need it for Lin/Win? It is simple fix, one liner.

1) That wasn't too clever from whomever implemented that artificial restriction. Meta, Super, Hyper and AltGr are often used on other platforms (Linux,FreeBSD,Windows) too.

2) It seems what your suggestion is just a partial fix and needs more work. I enabled Meta, Super, Hyper and AltGr as well (see attached screenshot). Yet, when I click the "Grab" button and press the key that generates Ctrl+Alt+Shift+Hyper+Up it doesn't recognise any of the new shiftstates that I enabled.

So it seems more work is required somewhere in the IDE or wigetset backend.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot.png Type: image/png Size: 9999 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170511/802f4152/attachment-0001.png>

Reply by email

Alexey
to Graeme Geldenhuys
Graeme Geldenhuys wrote
that generates Ctrl+Alt+Shift+Hyper+Up it doesn't recognise any of the new shiftstates

It must not see em. Laz dont know what is Hyper key, and Super. Shiftstate flags are none, AFAIK LCL dont support Hyper/Super keys

Regards, Alexey

Reply by email

Graeme Geldenhuys
to Alexey
Alexey wrote
It must not see em. Laz dont know what is Hyper key, and Super.

So it is a LCL bug then?

As I mentioned, I'm using LCL-GTK2, and I know FreeBSD supports those keys (tested with xev), and I know GTK2 supports those keys (test with The GIMP). So does Java applications (tested with jEdit), and fpGUI applications.

Attached is a screenshot where I tested keyboard shortcut "capturing" using The GIMP, which is compiled against GTK2 on my system.

I'll file a Mantis bug report.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot.png Type: image/png Size: 12368 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170511/cb4abb72/attachment.png>

Reply by email

Marc Weustink
to Graeme Geldenhuys: So it is a LCL bug then? As I mentioned, I'm using LCL-GTK2, and I know FreeBSD supports…
Graeme Geldenhuys wrote
On 2017-05-11 16:00, Alexey via Lazarus wrote: > It must not see em. Laz dont know what is Hyper key, and Super. So it is a LCL bug then?

Not sure, iirc I've implemented them in gtk. At least I recall me looking at all the different modifiers.

Marc

Show quoted text 13 lines
As I mentioned, I'm using LCL-GTK2, and I know FreeBSD supports those keys (tested with xev), and I know GTK2 supports those keys (test with The GIMP). So does Java applications (tested with jEdit), and fpGUI applications. Attached is a screenshot where I tested keyboard shortcut "capturing" using The GIMP, which is compiled against GTK2 on my system. I'll file a Mantis bug report. Regards, Graeme

Reply by email