kanata icon indicating copy to clipboard operation
kanata copied to clipboard

allow sequences to have an earlier defined sequence

Open SequentialDesign opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

sometimes i want to create a sequence whose beginning is the exact same as another sequence, and kanata does not let me do it. for example :

(defseq
sportsman (s p o r t s spc m a n spc)
sportsmanship (s p o r t s spc m a n spc s h i p spc)
)

is not allowed because the first part of the sportsmanship sequence starts exactly the same way as the entire sportsman sequence.

what i'm aiming for is the following :

chord sports, get sports. chord man right afterwards, get sportsman. this is all possible in kanata now with the following :

(defcfg
  danger-enable-cmd yes
  process-unmapped-keys yes
  concurrent-tap-hold yes
  sequence-input-mode visible-backspaced
  sequence-timeout 5000
)

(defvar
  cnto 200 ;; chord normal timeout
)

(defalias
sports (macro sldr s p o r t s spc)
man (macro m a n spc)
ship (macro s h i p spc)
)

;; ignore the exact letters i use to get stuff.  
;; you can use whatever
(defchordsv2-experimental
(m b c - o ins) @sports $cnto all-released ()
(t r s d a) @man $cnto all-released ()
(m r h u) @ship $cnto all-released ()
)

(defseq
sportsman (s p o r t s spc m a n spc)
;; sportsmanship (s p o r t s spc m a n spc s h i p spc) <-- won't work
)

(defvirtualkeys
sportsman (macro s p o r t s m a n spc)
;; sportsmanship (macro s p o r t s m a n s h i p spc)
)

and i would like sportsmanship to work as well just like sportsman does

Describe the solution you'd like.

it would be nice for sequences to work like eager tap-dance, where it's okay to for a trigger to share its beginning with another action

Describe alternatives you've considered.

i have not given much thought to this problem. i would be happy to hear about other solutions

Additional context

v2 chords are amazing. my issue seems like a trifle, but i nonetheless felt like it could be useful in some cases, even in those outside the realm of chording, and, of course, i would be very happy to have it

SequentialDesign avatar Nov 08 '24 07:11 SequentialDesign

This functionality seemed challenging to build into the current design of sequences; which is part the reason zippychord was added. Perhaps one can find a way to integrate the same functionality into sequences, but likely I won't ever get around to it.

jtroo avatar Jul 12 '25 23:07 jtroo