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

Amazing App!! Can we please get double-tap binding? #55

Open
Re73 opened this issue Nov 1, 2022 · 5 comments
Open

Amazing App!! Can we please get double-tap binding? #55

Re73 opened this issue Nov 1, 2022 · 5 comments

Comments

@Re73
Copy link

Re73 commented Nov 1, 2022

First off: this app is seriously AMAZING! Thank you SO MUCH for making it work for us!!!

Would it be possible to please add double-tap binding? https://superuser.com/a/1749562/1713699
The idea is to hit a control key twice, quickly, and bind that to an action. Eg, WIN+WIN or SHIFT+SHIFT or CMD+CMD, etc.
I'd happily buy you a couple of beers to see this implemented.

Thank you so much!!
Re

Screenshot 2022-11-01 at 3 05 31 PM

@deseven
Copy link
Owner

deseven commented Nov 1, 2022

Thank you for your kind words!

I'll try doing that at some point, but these days I have very little time to work on this tool, especially since it covers 100% of my needs, so no promises.

@Re73
Copy link
Author

Re73 commented Nov 1, 2022

Thank you for the quick response Ivan!

What's the best way for me to buy you a couple of beers meanwhile?

Thanks again so much!!!

@deseven
Copy link
Owner

deseven commented Nov 1, 2022

I don't look for donations, but thanks :)

@Re73
Copy link
Author

Re73 commented Dec 19, 2022

Hi, Ivan,

I got this working in python, any interest in using it to bind double taps of special keys?
This works to bind the double tap of the right command key.

Please let me know what you think.

Thanks again!

import keyboard
import time
import subprocess

lastime=0.0
pressed_once_or_more=False
MIN_INTERNVAL=0.4 #seconds
PROGRAM=['/usr/bin/open','/Applications/Safari.app']
SPECIAL_KEY='command'

print ("Welcome to a little utility function to bind SPECIAL_KEY+SPECIAL_KEY to launching a program")

while True:
    
    keyboard.wait(SPECIAL_KEY)
    t1=time.perf_counter()
    
    print("\nt1={}\nlasttime={}\n".format(t1,lastime))

    if (t1-lastime<MIN_INTERNVAL and pressed_once_or_more):
        print("******************CALLED!******************")
        subprocess.call(PROGRAM)

    lastime=t1
    pressed_once_or_more=True

@deseven
Copy link
Owner

deseven commented Dec 20, 2022

Hi, I really have nothing else to add to what I wrote before.

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

No branches or pull requests

2 participants