Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to disable keys in KMonad? #830

Open
sachamasry opened this issue Mar 31, 2024 · 4 comments
Open

Is it possible to disable keys in KMonad? #830

sachamasry opened this issue Mar 31, 2024 · 4 comments

Comments

@sachamasry
Copy link

I've just developed a problem with a stuck right Shift key on my MacBook Pro, which is a much bigger problem than I ever imagined.

Is there a way to completely disable the key in KMonad? In the past, I could have used Karabiner to disable the entire keyboard (disabling the Shift key, killed it on all attached keyboards), but if Karabiner is running, KMonad cannot run as it can't get exclusive access.

I would love to remap the key to emit nothing, but cannot think of a way to do it, and didn't see anything in the tutorial that would do the trick. Ideally, it would be nice to extend this to the entire keyboard, creating a completely blank layout, allowing an Atreus to sit on top of the physical keyboard, for example.

I'd be grateful for any help in killing this stuck key, as the problem is still there, able to cause quite a bit of pain, making the laptop useless.

I'm on KMonad: 0.4.2, commit a96f039
Running it on macOS Ventura: 13.6.3

@slotThe
Copy link
Member

slotThe commented Mar 31, 2024

You can try with XX; quoting from the tutorial:

  1. The 'XX' character evaluates to blocked. I.e. no action bound to that
    key-event in this layer, but do actually catch event, preventing any
    underlying layer from handling it.

@sachamasry
Copy link
Author

Hi @slotThe , I totally missed the 'XX' in the tutorial, and it is mentioned so many times...

However, it doesn't work! I've tried it in a dedicated layer, and nothing; I tried it in my base layer, disabling the 'Q' key, for example, and nothing. Running kmonad ... -l debug shows that the keypresses are being captured, and stdio shows them echoed.

--------------------------------------------------------------------------------
Received event: Press <q>
Running hooks
Registering untimed hook: 54
Emitting: Press <q>
q
--------------------------------------------------------------------------------
Received event: Release <q>
Running hooks
Emitting: Release <q>

Is this working for others?

You can try with XX; quoting from the tutorial:

  1. The 'XX' character evaluates to blocked. I.e. no action bound to that
    key-event in this layer, but do actually catch event, preventing any
    underlying layer from handling it.

@slotThe
Copy link
Member

slotThe commented Apr 1, 2024

It does work; for me at least. Changing my usual first layer

(deflayer colemak
  esc  mute vold volu                          prnt slck pause @Ins del  home pgup
       f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11   f12       end  pgdn
  `    1    2    3    4    5    6    7    8    9    0    -     =         bspc
  @tm  q    w    f    p    b    j    l    u    y    @;m  [     ]         ret
  @ec  a    r    s    t    g    m    n    e    i    o    '     \
  @sl  z    x    c    d    v    -    k    h    ,    .    @/c             @sr
  wkup lctl lmet lalt           spc            @sym cmps rctl       back up   fwd
                                                                    left down rght
)

to

(deflayer colemak
  esc  mute vold volu                          prnt slck pause @Ins del  home pgup
       f1   f2   f3   f4   f5   f6   f7   f8   f9   f10  f11   f12       end  pgdn
  `    XX   2    3    4    5    6    7    8    9    0    -     =         bspc
  @tm  q    w    f    p    b    j    l    u    y    @;m  [     ]         ret
  @ec  a    r    s    t    g    m    n    e    i    o    '     \
  @sl  z    x    c    d    v    -    k    h    ,    .    @/c             @sr
  wkup lctl lmet lalt           spc            @sym cmps rctl       back up   fwd
                                                                    left down rght
)

makes kmonad not emit a 1 when the respective key is pressed

@slotThe
Copy link
Member

slotThe commented Apr 10, 2024

@sachamasry any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants