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 there a way to bind one key to two? #14

Open
Spagett1 opened this issue Dec 9, 2021 · 5 comments
Open

Is there a way to bind one key to two? #14

Spagett1 opened this issue Dec 9, 2021 · 5 comments

Comments

@Spagett1
Copy link

Spagett1 commented Dec 9, 2021

I want my caps lock key to function as an esc key aswell as a modifier key, is this possible using kbct? i normally use this script

#!/bin/sh

# This script is called on startup to remap keys.
# Increase key speed via a rate change
xset r rate 300 50
# Map the caps lock key to super...
setxkbmap -option caps:super
# But when it is pressed only once, treat it as escape.
killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape'
# Map the menu button to right super as well.
xmodmap -e 'keycode 135 = Super_R'
# Turn off the caps lock if on since there is no longer a key for it.
xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock

this script only sets the esc key when the caps key is pressed quickly but i dont need this functionality, just want caps to be esc and mod4
however ive moved to wayland and none of those tools work. ive tried

- keyboards: [ "AT Translated Set 2 keyboard" ]

  keymap:
    capslock: esc
    capslock: leftmeta

but that just overwrites the esc and its only leftmeta. i also tried

- keyboards: [ "AT Translated Set 2 keyboard" ]

  keymap:
    capslock: esc,leftmeta

but that doesnt work.

Thanks!

@Spagett1
Copy link
Author

Spagett1 commented Dec 9, 2021

Now the program is not working at all for some reason, Currently im just using

- keyboards: [ "AT Translated Set 2 keyboard" ]

  keymap:
    capslock: esc

as a config file and running it with the command oas kbct remap --config /etc/kbct/config.yml
however while this does not give an error it does not bind the key.

@samvel1024
Copy link
Owner

Hey! Mapping from one to multiple keys is yet to be implemented (I am planning to work on that soon).

I am currently using a config where I map capslock to left alt. It's been working for me fine so far, so I'd suggest checking the logs for a message like INFO kbct > Capturing device path... to see if your keyboard is captured at all.

@Spagett1
Copy link
Author

Hey, thats awesome to hear its on the roadmap!

all the output i recieve from kbct is
INFO kbct > Starting kbct event loop, pid=3076

@samvel1024
Copy link
Owner

That means keyboard name is misconfigured (most likely).

Run sudo kbct list-devices (while having the keyboard connected) to find out the name.

@Ashark
Copy link

Ashark commented May 14, 2022

Looks like duplicate of #13

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

3 participants