slint icon indicating copy to clipboard operation
slint copied to clipboard

Expose keyboard modifiers in a way that permits access also from TouchArea's moved callback

Open tronical opened this issue 1 year ago • 3 comments

Access to the keyboard modifier states (shift, control, etc.) is currently limited to key events, pointer-events, and pointer-scroll events. Sometimes it may be necessary to access the state from within the moved callback of TouchArea as well. It would be nice if this as built-in functionality.

This could either mean we expose the keyboard modifier state as a global state (accessible anywhere), or perhaps we add an argument to the moved callback.

tronical avatar Nov 07 '23 08:11 tronical

We could add a property TextInputInterface.keyboard-modifiers of type KeyboardModifiers. https://slint.dev/releases/1.3.2/docs/slint/src/language/builtins/globals#textinputinterface https://slint.dev/releases/1.3.2/docs/slint/src/language/builtins/structs#keyboardmodifiers we probably should make sure that this is read only and cannot be modified in slint code

ogoffart avatar Jan 22 '24 12:01 ogoffart

I agree about TextInputInterface.keyboard-modifiers. That seems like a pragmatic choice.

tronical avatar Jan 22 '24 12:01 tronical