caasiu / gnome-shell-extension-KeysIndicator

Show <Ctrl> & <Shift> & <Alt> & NumLock & CapsLock status on Gnome panel
15 stars 7 forks source link

Suggestion to add more modifier keys, editing keys and touchpad lock functions #2

Closed brandleesee closed 9 months ago

brandleesee commented 8 years ago

May I suggest that the following are added as well:

Fn | Ins | Alt Gr

And albeit not a button an indicator for the Touchpad. This will save me from installing two extensions.

caasiu commented 8 years ago

Thanks for your suggestion.

First of all, I use Gdk.Keymap class to map the keyboard. And get_modifier_state() to detect the keys status. According to the Gdk Doc(Gdk.ModifierType):

Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.

There are no Fn | Ins keys and both Alt are the same.

To add thoses keys, I have to find a way to map the whole keyboard by using 'key-press-event' signal. Any suggestion?

Secondly, I don't understand what you talk about your Touchpad?

brandleesee commented 8 years ago

There are no Fn | Ins keys and both Alt are the same.

I get your meaning as, yes, FN & Ins are not modifier keys.

However, Alt and Alt Gr are not the same. When setting another language and special characters are used by the 'default' keyboard keys, the original keys can only be inserted/typed using Alt Gr not the normal Alt.

Any suggestion?

No, because I'm not well versed at the moment. If the issue was on Windows, I would have tried tackling it with AutoHotKey. Linux is a different story.

I don't understand what you talk about your Touchpad?

A two-in-one feature of both your extension and this or this. Of course, these do not have anything to do with modifiers etc, but thought Caps Lock, Num Lock and Touchpad Indicator would go well together.

caasiu commented 8 years ago

I get your meaning as, yes, FN & Ins are not modifier keys.

According to the Develper, there is GdkEventKey.keyval that can detect plenty of keys included Fn key and other language keyboard keys. But I don't know how to use it.

However, Alt and Alt Gr are not the same. When setting another language and special characters are used by the 'default' keyboard keys, the original keys can only be inserted/typed using Alt Gr not the normal Alt.

What I mean is both Alt will return the same keycode by using get_modifier_state() function, so I can't identify which one is Alt Gr.

brandleesee commented 8 years ago

Ah, I see. Well, your code as is is good enough. Thanks nonetheless.

gitfineon commented 6 years ago

@brandleesee Maybe you can change the title of this issue to something more specific like: "Add more modifier keys, editing keys and touchpad lock function" and @caasiu can label it as feature request, which may require to change the backend.

brandleesee commented 6 years ago

@gitfineon indeed, changed!