Hey all, I'm trying to see if the shift key is dow...
# compose-desktop
c
Hey all, I'm trying to see if the shift key is down while in an onClick event handler, is there a simple way to do this?
a
Only by looking at the AWT event I think.
c
oof
looks pretty... miserable lol
oop, this seems to be the way
Copy code
Window(
        onKeyEvent = {
            Keys.isShiftPressed.value = it.isShiftPressed
            false
        },
at least until someone tells me this is a terrible way and gives me a better way
but its a way!
t
There is the modifier
mouseClickable
which gives access to the keyboard modifiers:
Copy code
Modifier.mouseClickable { 
    keyboardModifiers.isShiftPressed
}
👍🏻 1