Long press action

Asked by Skeewiff on 2015-11-20

Under preferences > keyboard > advanced, we have long press action option

I would like to know of any tips on how to implement a code change to add an extra option:

- secondary key value

That would be equivalent to have shift pressed

ie SHIFTKEY + 2 = @
on my English International QWERTY keyboard


Question information

English Edit question
Onboard Edit question
No assignee Edit question
Last query:
Last reply:
marmuta (marmuta) said : #1

I would start with trying to simply press and release SHIFT around the normal key generation. Somewhere in key_long_press() in Onboard/Keyboard.py:

if config.keyboard.default_key_action == KeyCommon.SINGLE_STROKE_SHIFT_ACTION:
    lock = mods[Modifier.SHIFT]
    if lock:
    if lock:

Totally untested and the details would have to be worked out. I suspect it will cause side-effects with update_modifiers() at least. SINGLE_STROKE_SHIFT_ACTION would need to be added to at least KeyCommon.py and Config.py, class ConfigKeyboard, key "default-key-action". The strings visible in preferences are in settings.ui.

Hope that helps getting you started.

Skeewiff (marcelo-pm) said : #2

great! thanks for the hints

Can you help with this problem?

Provide an answer of your own, or ask Skeewiff for more information if necessary.

To post a message you must log in.