GokuRakuJoudo icon indicating copy to clipboard operation
GokuRakuJoudo copied to clipboard

How to implement dead keys like in workman dead key layout do?

Open sokinpui opened this issue 2 years ago • 0 comments

The idea of using 'dead' keys is based on assumption that pressing 2 easy keys is better than pressing hard key. So to make it easier to type (programming) characters/symbols, we're going to press an easily reachable key (which will NOT output any character), release it and then press another easily reachable key to produce, say, @ character.

I try to implement this in goku, since I use qwerty layout, while I find my code bug, after I press period, I cannot exit the dead-mode anymore, also, the period is displayed on the screen before I press another key. The following code try to implement that: tap period key . to enter dead-mode, then type d to display (.

{:des "dead key mode"
  :rules [
    [:period [["dead-mode" 0]] ["dead-mode" 1]]
    [:d
        [["dead-mode" 1] :!S9]
        ["dead-mode" 0]
        {:delayed {:invoked ["dead-mode" 0] :canceled ["dead-mode" 0]} :params {:delay 300}}]
    ]}

What should I improve to implement dead key?

sokinpui avatar Feb 27 '23 04:02 sokinpui