Recent

Author Topic: Keyboard AltGr key  (Read 4565 times)

MaxCuriosus

  • Full Member
  • ***
  • Posts: 124
Keyboard AltGr key
« on: February 04, 2022, 11:15:27 pm »
Keyboard AltGr key not operational with any second key in Lazarus IDE, with

MS Wired Keyboard 600 (model 1576)
Lazarus 2.0.10
x86_64-linux-gtk2
Debian 11.2

It works fine with "gedit" editor and the terminal.

Is there some kind of related settings in Lazarus IDE I should be aware of?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8101
  • Debugger - SynEdit - and more
    • wiki
Re: Keyboard AltGr key
« Reply #1 on: February 05, 2022, 12:45:52 am »
What exactly is "not operational"? And are "any second key" other control keys, or letter/digit keys?

Usually the IDE treats AltGr as alt + ctrl.

So then it depends, what your typing, and if it conflicts with other key combos.
For example alt + ctrl + w opens the watches window. But that means, if your local keyboard has some other "input" assigned to that, that other "input" is blocked.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 124
Re: Keyboard AltGr key
« Reply #2 on: February 05, 2022, 08:41:09 pm »
By not operational I mean that AltGr plus a second key doesn't yield anything. For example with that particular keyboard I should get certain special characters as follow:

AltGr + 2 --> @
AltGr + 3 --> #
AltGr + e --> €
AltGr + à --> {
AltGr + $ --> }
AltGr + è --> [
AltGr + ¨ --> ]

but I don't. Likewise with Alt + Ctrl + .

winni

  • Hero Member
  • *****
  • Posts: 3125
Re: Keyboard AltGr key
« Reply #3 on: February 05, 2022, 10:21:36 pm »
Hi!

That depends on the keyboard driver of the OS. For german keyboards you got for example this connection:

AltGr q --> @

Test your AltGr key binding in some simple editor like joe.

Winni


MarkMLl

  • Hero Member
  • *****
  • Posts: 4775
Re: Keyboard AltGr key
« Reply #4 on: February 05, 2022, 11:27:34 pm »
Keyboard AltGr key not operational with any second key in Lazarus IDE, with

This is a bit of a minefield. I've been looking recently at the <Shift><AltGr> "compose key" functionality, and it varies enormously over different WMs and apps.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8101
  • Debugger - SynEdit - and more
    • wiki
Re: Keyboard AltGr key
« Reply #5 on: February 05, 2022, 11:53:48 pm »
Well his key bindings must be set to the correct language, if it works in other apps.

Good point about VM, etc.   @MaxCuriosus: Please mention if this is running in a VM, or in via any sort of remote connection.
There are known issues with at least one remote tool, where some keycodes are sent in an (according to my research) "undocumented" way. But 99% of apps ignore this, and work. Unfortunately LCL is in the list of those affected. (I don't recall the details...)

I don't think the IDE has anything on ctrl+alt+2 (But you can check in the keymapping (tools > options > editor > keymapping). So the IDE should not be "eating" this key stroke.
Btw, the key-mapping page also has a "capture key" tool. You could check what the LCL records for your ctrl+alt+2




Beyond this, there may be prior bug reports. You may want to search the issue tracker.



In the context of other keyboard issues....

I had a look, for more verbose logging, compile the IDE with
-dVerboseKeyboard -dVerboseKeys

and (if compiles) -dVerboseModifiermap

---
There are also alternative implementations, but they are ages old, and likely will not compile / And I have no idea what they do, or if they will affect you (if they still work....)
-dUseOwnShiftState

and/or
-dUse_KeyStateList

And then run the IDE from a terminal to see any output (or use --debug-log=filename

Though I can't promise that much will come from this. If it reveals an issue, it can at least be reported with some information to it.
I wont be able to do much about it myself.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 124
Re: Keyboard AltGr key
« Reply #6 on: February 06, 2022, 08:49:06 pm »
winni,
take a look at the attached keyboard layout as seen by the Debian OS. It does correspond to the physical layout of the keyboard.

I can get the special characters in various applications, including

nano
GNOME Terminal
gedit
Nautilus (default file manager of the GNOME desktop)
LibreOffice
etc.

The behavior is the same with another similar keyboard (different make and model).
The bahavior is also the same regardless of the OS installation language, en-US or otherwise.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 124
Re: Keyboard AltGr key
« Reply #7 on: February 06, 2022, 08:50:13 pm »
Martin_fr,
no VM, no remote connection, it's a plain vanilla system configuration, so to speak.
Keymapping doesn't show anything unusual (default installation configuration) and nothing for Alt+Ctrl+2.
I've noticed the problem with the Lazarus editor but in a running application, using for instance a component like TEdit, it works fine.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8101
  • Debugger - SynEdit - and more
    • wiki
Re: Keyboard AltGr key
« Reply #8 on: February 06, 2022, 09:23:07 pm »
TEdit maps directly into a gtk2 widget.

TSynEdit, any TCustomControl, any OnKeyPress event, ... they have different key handling.

dbannon

  • Hero Member
  • *****
  • Posts: 2045
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Keyboard AltGr key
« Reply #9 on: February 07, 2022, 12:46:28 am »
Now, wild suggestion. I suspect this issue is a about getting the extended characters ?   If not, please stop reading.

Does it do the extended characters via the "compose Key" method ? I ask because I have never heard of a AltGr key and I don't use extended characters.

This bug https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38454 points out that Lazarus components don't handle the compose key approach correctly, with each component seeming to deliver its own special error. Its a UTF8 issue I understand.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8101
  • Debugger - SynEdit - and more
    • wiki
Re: Keyboard AltGr key
« Reply #10 on: February 07, 2022, 01:44:00 am »
I think the compose issue is likely a different issue (though it could end up being caused by related code, even if maybe just coincidental).

The "compose" issue has had various reports. Usually as "dead key" issue. E.g. https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/15688

MarkMLl

  • Hero Member
  • *****
  • Posts: 4775
Re: Keyboard AltGr key
« Reply #11 on: February 07, 2022, 09:10:19 am »
I think the compose issue is likely a different issue (though it could end up being caused by related code, even if maybe just coincidental).

The "compose" issue has had various reports. Usually as "dead key" issue. E.g. https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/15688

Reading around, it's an interaction of window manager and widget set. It might be possible to "tune" the WM aspect of it by fudges at the X level, but the bottom line is that most people don't and TBH shouldn't have to to get the widget set working properly.

With all of these things there's a possibility that it's in the LCL interface code, but TBH I'd be surprised.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3125
Re: Keyboard AltGr key
« Reply #12 on: February 07, 2022, 10:26:44 am »


Does it do the extended characters via the "compose Key" method ? I ask because I have never heard of a AltGr key and I don't use extended characters.

Davo

Hi!

For your information.

AltGr is default on german keyboards

It is used for typing @ € µ ² ³ and some others.

Winni


MaxCuriosus

  • Full Member
  • ***
  • Posts: 124
Re: Keyboard AltGr key
« Reply #13 on: February 07, 2022, 03:37:48 pm »
I'm not sure what to conclude. Which one of the following apply:

1) AltGr not planned to be implemented in Lazarus editor
2) The implementation has been overlooked
3) There is an incompatibility with Linux distribution
4) There is a bug
5) or else?

Note that with the same Lazarus version and keyboard, AltGr works fine with Debian 10.7!

dseligo

  • Hero Member
  • *****
  • Posts: 651
Re: Keyboard AltGr key
« Reply #14 on: February 07, 2022, 06:17:45 pm »
Note that with the same Lazarus version and keyboard, AltGr works fine with Debian 10.7!

And it works just fine in Windows too.

Did you try to capture it with 'capture key' tool, as Martin_fr suggested?

Quote from: Martin_fr
you can check in the keymapping (tools > options > editor > keymapping). So the IDE should not be "eating" this key stroke.
Btw, the key-mapping page also has a "capture key" tool. You could check what the LCL records for your ctrl+alt+2

 

TinyPortal © 2005-2018