Long press action

Asked by Skeewiff

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

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Onboard Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
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:
        self._text_changer.do_lock_mod(Modifier.SHIFT)
    self.key_down(key)
    self.key_up(key)
    if lock:
        self._text_changer.do_unlock_mod(Modifier.SHIFT)

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.

Revision history for this message
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.