RFR: 8308644: [Linux] Simplify and fix small bugs on glass key related events

Thiago Milczarek Sayao tsayao at openjdk.org
Tue May 23 22:49:04 UTC 2023


On Tue, 23 May 2023 16:08:01 GMT, Martin Fox <duke at openjdk.org> wrote:

>> While working on IME I noticed this code could be simplified, so I removed the `g_hash_table` usage for a simple struct ordered for binary search (I'm sure it's ordered because I did a simple app to generate it ordered).
>> 
>> This also fixes:
>> 
>> - UNKNOWN key codes being sent on KEY_PRESS;
>> - Alt Gr is now working;
>> - Replaced X calls with GDK calls for key locked check for as a small step towards supporting Wayland in the future
>> - Added missing mappings (for F13 - F24 and dead keys) - Linux does not send dead keys as keypress but sends as key release, and they might be used on a robot test, so it's now covered.
>
> modules/javafx.graphics/src/main/native-glass/gtk/glass_key.cpp line 310:
> 
>> 308:     glass_mask |= (mask & GDK_BUTTON5_MASK) ? com_sun_glass_events_KeyEvent_MODIFIER_BUTTON_FORWARD : 0;
>> 309:     glass_mask |= (mask & GDK_SUPER_MASK) ? com_sun_glass_events_KeyEvent_MODIFIER_WINDOWS : 0;
>> 310:     glass_mask |= (mask & GDK_META_MASK) ? com_sun_glass_events_KeyEvent_MODIFIER_WINDOWS : 0;
> 
> Have you been able to generate the Super and Meta modifiers? Googling around it seems the original keys were on the 1978 Space-cadet keyboard and there seems to be some debate as to how these modifiers should be emulated on a modern keyboard. I wouldn't change this unless a user has entered a bug.

Yeah, they seem unused. This is mostly used on other events modifiers, like mouse dragging and probably will never touch GDK_META_MASK.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1143#discussion_r1203115090


More information about the openjfx-dev mailing list