Sign in to follow this  
Followers 0
Kulanb

Keypad "000" as a hotkey

7 posts in this topic

Hi folks,

I'm partly a noob, but I'm learning fast. I have written a script to bind my entire external keypad to hotkeys. Problem is, the keypad has a special "000" key. The problem I'm encountering is the Keypad000 is really just a built-in circuit that pulses the "0" key three times. I've tried using a counter and a timer to capure three 0's within a specified time frame to detect a numpad000 'else' pass on just a single numpad0 but I'm still having trouble with it. It's proven to be a challenge. Has anyone out there got a better solution? I'm embarassed to say I've spent a day and a half on this with mixed results. I've seen someone's solution here but with a beta or something, the code is not compatible with V3. I'm also having a hard time translating it into V3 code. Any help would be met with cheers and mug of the finest ale if we ever meet. I live in Toronto, Ontario, Canada BTW.

Here is what I have so far, I just put focus in a TXT file while running it to capture the results. I think I need to find better solution for the timestamping...

HotKeySet("{numpad0}", "num0")
$num0=0
$time=TimerInit()

while 1
    $num0=0 
wend

func num0()
    $time=TimerInit()
    $num0=$num0+1
    if $num0=3 then
        send("n000 is pressed{enter}");XXXXX NUMPAD 000 FUNCTION HERE XXXXX
        $num0=0
    elseif $num0<3 then
        send("n0 is pressed{enter}");XXXXX NUMPAD 0 FUNCTION HERE XXXXX
        
    endif
endfunc

Share this post


Link to post
Share on other sites



Hi folks,

I'm partly a noob, but I'm learning fast. I have written a script to bind my entire external keypad to hotkeys. Problem is, the keypad has a special "000" key. The problem I'm encountering is the Keypad000 is really just a built-in circuit that pulses the "0" key three times. I've tried using a counter and a timer to capure three 0's within a specified time frame to detect a numpad000 'else' pass on just a single numpad0 but I'm still having trouble with it. It's proven to be a challenge. Has anyone out there got a better solution? I'm embarassed to say I've spent a day and a half on this with mixed results. I've seen someone's solution here but with a beta or something, the code is not compatible with V3. I'm also having a hard time translating it into V3 code. Any help would be met with cheers and mug of the finest ale if we ever meet. I live in Toronto, Ontario, Canada BTW.

Here is what I have so far, I just put focus in a TXT file while running it to capture the results. I think I need to find better solution for the timestamping...

HotKeySet("{numpad0}", "num0")
$num0=0
$time=TimerInit()

while 1
    $num0=0 
wend

func num0()
    $time=TimerInit()
    $num0=$num0+1
    if $num0=3 then
        send("n000 is pressed{enter}");XXXXX NUMPAD 000 FUNCTION HERE XXXXX
        $num0=0
    elseif $num0<3 then
        send("n0 is pressed{enter}");XXXXX NUMPAD 0 FUNCTION HERE XXXXX
        
    endif
endfunc
i want to say gary (gafrost) wrote something a while back, that i've used for other things, but it was an script to watch for a password to be typed, without gui or anything. you could probably tailor it to your needs, but it does require beta. If you don't want to install beta (beta really is a good way to go) then i'd suggest for simplicity sake to just use a different hotkey...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

i want to say gary (gafrost) wrote something a while back, that i've used for other things, but it was an script to watch for a password to be typed, without gui or anything. you could probably tailor it to your needs, but it does require beta. If you don't want to install beta (beta really is a good way to go) then i'd suggest for simplicity sake to just use a different hotkey...

I REALLY wanted the use of that button, but I may have to give up and live without it :o . I installed the beta but I'm no further ahead. Thanks for the advice though, I appreciate it.

~K~

Share this post


Link to post
Share on other sites

I REALLY wanted the use of that button, but I may have to give up and live without it :o . I installed the beta but I'm no further ahead. Thanks for the advice though, I appreciate it.

~K~

HI,

just a short try. Does that work?

HotKeySet("0", "num0")
Dim $i = 1
Dim $dif, $begin = 0

While 1
    Sleep(100)
WEnd

Func num0()
    If $i = 1 Then
        $begin = TimerInit()
    EndIf
        $dif = TimerDiff($begin)
    If $i = 3 And $dif < 1500 Then
        Send(" 3 times ")
        $i = 0
        $begin = TimerInit()
    EndIf
    $i += 1
    If $dif > 1500 Then
        $begin = TimerInit()
        $i = 0
    EndIf
EndFunc  ;==>num0

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

$i += 1
I fixed the typo ($i=$i+1 ?) and made some timer adjustments. It's darn close but not consistant. I'll play around with this one and see what I can do.

Thanks alot though!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I fixed the typo ($i=$i+1 ?) and made some timer adjustments. It's darn close but not consistant. I'll play around with this one and see what I can do.

Thanks alot though!

$i += 1 is Beta, the same as your $i = $i + 1

Edit:

lol, forgot the first variable identifier!! :o

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$i += 1 is Beta, the same as your $i = $i + 1

heh, hence the term "newb"! Edited by Kulanb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0