Read if key is being pressed

Feature request

Hello, we would love to be able to read if a key is being pressed, to better make use of keyboard commands while in the app.

One use case is to select a number of rows between an already selected row in a table. Same behaviour as you would have in Excel or Sheets, when selecting a second field whilst holding Shift - all fields between the first and second field is selected (if second field is selected whilst pressing Shift)

Any chance this is possible to do now, or might be coming soon?

Hello @Kare :slight_smile:

We do have keyboard shortcuts and the possibility to read if a key is being pressed already. I assume you already know, but in case you have not used it, you can take a look here:

, and here under Keyboard event handlers:

But the multi-select functionality that you described below, we only have as a check-box (built-in) feature on the relevant UI components (such as a table).

We will register a challenge on this being possible to do by using the keyboard shortcut + SHIFT (as in Excel and Google Sheets).

Will update you on if and when this can be expected!

Hello @nejrabrc!

We know very well the keyboard shortcut feature, but the issue here is about reading if the button is being pressed. Right now, we can only run an action based on pressing buttons, but we want to, when clicking on a row and running an action there, check if the shift key is being pressed at that moment.

I’ve tried to hack this by setting an app variable to be true when pressing fx shift+j key, but then I need to turn it off with a timer after some X sec. Basically, I cannot read when the buttons are not pressed anymore. So that kind of works but feels unstable.

Also, looks like keyboard shortcuts are limited to modifier + special key, but in this case I would like to use only a modifier (shift)

Any hacks are also very much welcome!

Actually, we can run event.shiftKey from a function!


1 Like