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

Can we have clicker support #720

Open
Snajj opened this issue Feb 26, 2023 · 3 comments
Open

Can we have clicker support #720

Snajj opened this issue Feb 26, 2023 · 3 comments

Comments

@Snajj
Copy link

Snajj commented Feb 26, 2023

Hello,
I need a high signal output from pico when any key is pressed.
I will then feed it to a piezo crystal or buffer it with a mosfet and run a solenoid with it to add some fun to my keyboard.
I leaned that hijacking the matrix to get this signal directly isn't a trivial matter so I need one of the pins of the pico supplying it.
Is this possible with the current KMK? If it is not can it be added? With KMK having so many features is is odd that something this trivial is missing. Thanks.

@xs5871
Copy link
Collaborator

xs5871 commented Feb 26, 2023

KMK is built upon Circuitpython. You can use any Circuitpython library you want. For example digitalio, or even
adiopwm.

@Snajj
Copy link
Author

Snajj commented Feb 26, 2023

KMK is built upon Circuitpython. You can use any Circuitpython library you want. For example digitalio, or even adiopwm.

I see, my Python is very rusty. Which function can I use to get a key press signal. self.get_caps_lock seems to get True when Caps Lock is enabled and false when it is disabled. Is there a similar function that gives true when a key is pressed and false when key is let go.

If I can get one of the lock status LEDs blink when a key is pressed I can use that signal to drive my solenoid.

@xs5871
Copy link
Collaborator

xs5871 commented Feb 28, 2023

CapsLock (and the other locks) aren't propagated through key presses. Those are host-side settings that are send to the keyboard via USB.
The module class implements the method process_key, which is being called for every physical button press/release and one of its parameters is is_pressed.

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