gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

keyboard.c: Overriding binding to only `(kdb "S")`


From: Artur Zochniak
Subject: keyboard.c: Overriding binding to only `(kdb "S")`
Date: Thu, 29 Sep 2016 18:43:32 +0200

Hello Emacs Community!

So I am trying to fight with RSI and 
I would like to have sticky modifier key for Emacs25
https://www.emacswiki.org/emacs/StickyModifiers
http://ergoemacs.org/emacs/emacs_pinky.html#Use_Sticky_Keys 
with a debouncer, this means: 

  (global-set-key (kdb "S") 'debounced-shift)

  ; if user presses shift - keep it pressed till either another 
  ;key is pressed (make it upper char) or elapsed 30 sec
  ; pseudo-code ofc
  (defn debounced-shift []
    (set-modifier-key 'shift)
    (setq last-pressed-key 'shift)
    (run-with-timer '30 sec' (lambda () (unset-modifier-key 'shift)))
  )

so far I have digged to this moment https://github.com/emacs-mirror/emacs/blob/b3e1b38/src/keyboard.c#L3470-L3479 

Can somebody instruct me what has to be done so I am able to get for example (global-set-key (kdb "S") 'newline-and-indent)?

Thanks!

BR
Artur

reply via email to

[Prev in Thread] Current Thread [Next in Thread]