Jump to content


Photo

debounce problem


  • Please log in to reply
9 replies to this topic

#1 jsm

jsm
  • Members
  • 110 posts

Posted 03 August 2012 - 12:26 AM

I am trying to write a script that only writes the letter n once when pressed,as my n key is faulty.
when ever i press n it may write it twice. so the code is a debouce issue that doesn't work
cann someone help please .
n::   
   If (A_TimeSincePriorHotkey < 10) ;hyperclick
      Return
   send n
   KeyWait, n
   
Retur


#2 guest3456

guest3456
  • Members
  • 1325 posts

Posted 03 August 2012 - 12:50 AM

whats wrong with your script?

#3 jsm

jsm
  • Members
  • 110 posts

Posted 03 August 2012 - 12:58 AM

doesn't work

#4 guest3456

guest3456
  • Members
  • 1325 posts

Posted 03 August 2012 - 01:08 AM

what happens when you try?

#5 jsm

jsm
  • Members
  • 110 posts

Posted 03 August 2012 - 01:28 AM

I press the n key in notepad and it doesn't display the n key

#6 guest3456

guest3456
  • Members
  • 1325 posts

Posted 03 August 2012 - 01:46 AM

try the $ prefix on your hotkey
<!-- m -->http://www.autohotke...ocs/Hotkeys.htm<!-- m -->

$n::

#7 jsm

jsm
  • Members
  • 110 posts

Posted 03 August 2012 - 02:14 AM

still no go

#8 guest3456

guest3456
  • Members
  • 1325 posts

Posted 03 August 2012 - 03:40 AM

works for me...

#9 jsm

jsm
  • Members
  • 110 posts

Posted 03 August 2012 - 04:18 AM

whatsn your code

#10 guest3456

guest3456
  • Members
  • 1325 posts

Posted 03 August 2012 - 05:45 AM

$n::   
   If (A_TimeSincePriorHotkey < 10) ;hyperclick
      Return
   send n
   KeyWait, n
   
Return

i'm using AHK basic. the only thing that doesnt work is the very first press of 'n' probably because of the A_PriorHotkey check. after that, it sends one 'n' to Notepad