Maniphest T76429

GHOST/Wayland event's don't correspond to physical keys
Closed, Resolved

Assigned To
Campbell Barton (campbellbarton)
Authored By
Campbell Barton (campbellbarton)
May 5 2020, 3:48 AM
Tags
  • BF Blender
Subscribers
Campbell Barton (campbellbarton)
Christian Rauch (christian.rauch)

Description

With WITH_GHOST_WAYLAND enabled, the GHOST_TKey value from events don't correspond to physical keys.

For all other platforms, it's possible to press a key with Shift held, without this modifier changing to the GHOST_TKey.

So for example you can map a key to Shift+1 without the GHOST_TKey being set to an exclamation value.

Currently with Wayland, the value is translated so holding shift changes the value.


To test:

  • Enable WITH_GHOST_DEBUG build option.
  • Run the animation player (for simple testing) blender -a /path/to/image.png
  • Press the 1. key: 1 is printed to the stdout.
  • Hold Shift and press 1. key: unknown is printed to the stdout.

Revisions and Commits

rB Blender
Abandoned

Event Timeline

Campbell Barton (campbellbarton) created this task.May 5 2020, 3:48 AM
Campbell Barton (campbellbarton) mentioned this in T76428: GHOST/Wayland Support.
Christian Rauch (christian.rauch) added a subscriber: Christian Rauch (christian.rauch).May 5 2020, 6:21 PM

I can reproduce this. The function xkb_map_gkey receives the XKB_KEY_exclam key, but there is no corresponding GHOST_TKey. It will, therefore, print unhandled key: 33 (XKB_KEY_exclam).

Is GHOST suppose to translate key combinations, e.g. receive Shift + 1 and send !, or should it simply forward hardware keys, e.g. just send Shift and then send 1?

Christian Rauch (christian.rauch) mentioned this in D7632: Send key symbols on Wayland without modifier..May 6 2020, 12:51 AM
Christian Rauch (christian.rauch) added a revision: D7632: Send key symbols on Wayland without modifier..May 6 2020, 12:53 AM
Campbell Barton (campbellbarton) added a comment.May 6 2020, 12:54 AM

should it simply forward hardware keys, e.g. just send Shift and then send 1?

Yes, this is what's expected, there is the ascii and utf8 members which are used at any time where text value needs to be read from the key.

Christian Rauch (christian.rauch) added a comment.May 6 2020, 1:04 AM
In T76429#925038, @Campbell Barton (campbellbarton) wrote:

Yes, this is what's expected, there is the ascii and utf8 members which are used at any time where text value needs to be read from the key.

This is now fixed in https://developer.blender.org/D7632. The modifiers are only used to obtain the utf8 representation. The "raw" key symbol is now mapped without modifiers.

Campbell Barton (campbellbarton) closed this task as Resolved by committing rB4af9578ab794: Fix T76429: GHOST/Wayland event's don't correspond to physical keys.May 6 2020, 2:21 AM
Campbell Barton (campbellbarton) claimed this task.
Campbell Barton (campbellbarton) added a commit: rB4af9578ab794: Fix T76429: GHOST/Wayland event's don't correspond to physical keys.