GHOST/Wayland event's don't correspond to physical keys #76429

Closed
opened 2020-05-05 03:48:06 +02:00 by Campbell Barton · 7 comments

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.
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.
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Added subscriber: @christian.rauch

Added subscriber: @christian.rauch

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?

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`?
Author
Owner

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.

> 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.

In #76429#925038, @ideasman42 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.

> In #76429#925038, @ideasman42 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.

This issue was referenced by 4af9578ab7

This issue was referenced by 4af9578ab794b10ea6742db0dc8d528646beee07
Author
Owner

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Campbell Barton self-assigned this 2020-05-06 02:21:40 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#76429
No description provided.