[Lazarus] Insufficient keyboard modifiers support in IDE

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
  Hm, on OSX, IDE shows key grab dialog [in keymapping opts] with
additional checkbox,
"Meta". It is what yo need?
Ctrl+Meta checkboxes - for keys Ctrl/Command.

And dialog works for Meta.
Alexey
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
On 2017-05-11 13:47, Alexey via Lazarus 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus

Screenshot.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
 >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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
On 2017-05-11 15:28, Alexey via Lazarus 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus

Screenshot.png (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
On 11.05.2017 17:50, Graeme Geldenhuys via Lazarus 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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
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?

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

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus

Screenshot.png (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
On 2017-05-11 16:21, Graeme Geldenhuys via Lazarus wrote:
> I'll file a Mantis bug report.


Reported as:

   https://mantis.freepascal.org/view.php?id=31797


Many thanks for your help and time Alexey.

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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list


On May 11, 2017 5:21:49 PM GMT+02:00, Graeme Geldenhuys via Lazarus <[hidden email]> 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


>
>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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Insufficient keyboard modifiers support in IDE

Free Pascal - Lazarus mailing list

So it is a LCL bug then?
Seems LCL ok:
- Windows key works, it is ssMeta [on GTK2 too]
- Super key [not Windows key] not known to LCL
- Hyper key too not known
- AltGr works here, in GTK2 it gives Alt.


-- 
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus