You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
As identified in godotengine/godot#23439, InputEvent's device property is always 0. Not being able to differentiate between devices causes issues such as godotengine/godot#53033. In addition, there are various proposals that require differentiating between devices and obtaining a device's properties (#19, #426, #3749).
Currently, on the linuxbsd platform, a combination of the core input protocol and XInput2 is used to process input events. XInput2 is currently only used for touch events, retrieving raw motion data and extracting tablet pen properties. The core input protocol does not provide information about which device generated the event. XInput2 does. XInput2 also provides the ability to extract all devices' properties.
Note: When support for touch events was added (godotengine/godot#14347) in 2017, it was not assumed XInput2 would be available. However when support for retrieving raw motion data was added (godotengine/godot@cf124b1) in 2018, it was assumed XInput 2.0 would be available. XInput 2.0 has been available since 2009 and v2.3 (the current version) has been available since 2012[1]; although currently we only require XInput 2.2 (for touch events). I think it's safe to assume that XInput2 v2.2 is available.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Use XInput2, which contains the source device's id, instead of the core input protocol to process input events.
Use XInput2's to extract device info so it's available for #3749.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Use XInput2's XIDeviceEvents for XI_KeyPress, XI_KeyRelease, XI_ButtonPress, XI_ButtonRelease, XI_Motion, XI_TouchBegin, XI_TouchUpdate and XI_TouchEnd events.
Use XInput2's XIDeviceEvent.sourceid member to assign InputEvent's device property.
Stop processing the core protocol's XKeyEvent, XButtonEvent and XMotionEvents for KeyPress, KeyRelease, ButtonPress, ButtonRelease and MotionNotify events.
Use XInput2's XIDeviceInfo to extract all device info for all input devices.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It's linuxbsd platform code.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
As identified in godotengine/godot#23439,
InputEvent's
device property is always 0. Not being able to differentiate between devices causes issues such as godotengine/godot#53033. In addition, there are various proposals that require differentiating between devices and obtaining a device's properties (#19, #426, #3749).Currently, on the
linuxbsd
platform, a combination of the core input protocol and XInput2 is used to process input events. XInput2 is currently only used for touch events, retrieving raw motion data and extracting tablet pen properties. The core input protocol does not provide information about which device generated the event. XInput2 does. XInput2 also provides the ability to extract all devices' properties.Note: When support for touch events was added (godotengine/godot#14347) in 2017, it was not assumed XInput2 would be available. However when support for retrieving raw motion data was added (godotengine/godot@cf124b1) in 2018, it was assumed XInput 2.0 would be available. XInput 2.0 has been available since 2009 and v2.3 (the current version) has been available since 2012[1]; although currently we only require XInput 2.2 (for touch events). I think it's safe to assume that XInput2 v2.2 is available.
[1] https://gitlab.freedesktop.org/xorg/proto/inputproto/-/blob/master/specs/XI2proto.txt
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Use XInput2, which contains the source device's id, instead of the core input protocol to process input events.
Use XInput2's to extract device info so it's available for #3749.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
XIDeviceEvent
s forXI_KeyPress
,XI_KeyRelease
,XI_ButtonPress
,XI_ButtonRelease
,XI_Motion
,XI_TouchBegin
,XI_TouchUpdate
andXI_TouchEnd
events.XIDeviceEvent.sourceid
member to assignInputEvent
'sdevice
property.XKeyEvent
,XButtonEvent
andXMotionEvent
s forKeyPress
,KeyRelease
,ButtonPress
,ButtonRelease
andMotionNotify
events.XIDeviceInfo
to extract all device info for all input devices.If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It's
linuxbsd
platform code.The text was updated successfully, but these errors were encountered: