jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
2.13k stars 110 forks source link

Feature request: AHK style hotstrings #1175

Open mastermach50 opened 1 month ago

mastermach50 commented 1 month ago

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

I am new here and I am not sure if something like this already exists. AHK style hotstrings would be nice to have especially for filling out forms.

in AHK I can add

:b0o:samplemail::@gmail.com

so that the following keysequence

s a m p l e m a i l spc

will result in the following keys being sent in order

bspc @ g m a i l . c o m

Is there currently a way to do this?

Describe the solution you'd like.

.

Describe alternatives you've considered.

.

Additional context

Are there any places I can discuss stuff related to kanata like a discord server?

gerhard-h commented 1 month ago

When using the interception version of kanata autohotkey hotstrings still work (that's what I use) maybe it works with the winIOv2 version too.

kanata itself has a leaderkey system called sequences (see the docs)

I'm not used to leaderkeys and tried to emulate hotstrings with this trigger key I made for proof of concept

  trigger (switch
    ((and (key-history d 2) (key-history t 1 ))) (multi  bspc rpt @.fashing) break
    ((and (key-history j 2) (key-history u 1 ))) (macro bspc bspc d i d  spc j u ) break
    ((and (key-history x 2) (key-history v 1 ))) (macro  x  v spc n o t spc m a t t e r s ) break
    ((and (key-history p 1 ) lsft)) (macro   spc f i r s t ) break ;; do hold-Shift + tap-p 
    ((key-history lsft 2)(key-history , 1)) (macro spc s e c o n d) break ;; this is OR joint... 
    ((key-history , 1)) (macro  k o m m a) break ;; ... never reached 
    ((key-history < 1)) (macro  l e f t <) break ;; this is repeatable, because the trigger is at the end
       ((key-history ´ 1))  (fork (macro (unicode é) F17) (macro (unicode É) F17) (lsft rsft)) break ;; F17 just for key consumption
    () XX break
  )

maybe it can be bound to space by replacing XX with spc

jtroo commented 1 month ago

The best place for discussions that I look at would be GitHub discussions.


For hotstring-like functionality I use sequences. There's an issue somewhere where someone posted their patch to Kanata to have sequences always-on which is more like hotstrings. My sequences are short (3 letters) and some coincide with real segments of words, so I prefer explicit activation.