Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 02:49:28 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Question about AutoHotkey scripting  (Read 6966 times)

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Question about AutoHotkey scripting
« on: August 01, 2010, 01:03:58 PM »
Is it possible to create a hotkey that does not require simultaneous pressing of keys?

For example, I would like to create a hotkey combination that is based on pressing two keys in rapid succession like "KK" or "KL".

Thanks,
jdd

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #1 on: August 01, 2010, 01:12:41 PM »
you might try TapTap Hotkey Extender:
http://www.donationc...dex.php?topic=5971.0

J-Mac

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 2,905
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #2 on: August 01, 2010, 03:33:44 PM »
you might try TapTap Hotkey Extender:
http://www.donationc...dex.php?topic=5971.0

mouser,

Last update in November 2006? The download page claims it only works through XP. True?

Thank you.

Jim

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #3 on: August 01, 2010, 03:38:55 PM »
Quote
The download page claims it only works through XP. True?
lies!

J-Mac

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 2,905
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #4 on: August 01, 2010, 03:52:39 PM »
 :harhar:

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #5 on: August 01, 2010, 06:47:27 PM »
so.....is it correct to assume that it is not possible to create a hotkey combination in Autohotkey that is based on pressing two keys in rapid succession?

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,501
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #6 on: August 01, 2010, 07:50:21 PM »
so.....is it correct to assume that it is not possible to create a hotkey combination in Autohotkey that is based on pressing two keys in rapid succession?

no sure I'd so far as to say that, but I'm not sure how I'd approach it...

perhaps a hotkey for K that watches for a subsequent (K) key press within a defined period 

OkRob

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #7 on: August 01, 2010, 08:37:43 PM »
Not sure what you're trying to send by pressing the keys, but something like this works:

Code: Autohotkey
  1. :R*?:ttt::
  2. FormatTime, CurrentDateTime,, HH:mm
  3. SendInput %CurrentDateTime%
  4. return
  5.  
Pressing the "t" 3 times sends the current time in HH:mm format

To send a text string, this works:

Code: Autohotkey
  1. :R*?:ppp::
  2. SendInput This is my string of text
  3. return
  4.  
Typing "p" 3 times sends This is my string of text

Might try something along those lines if it will work for you. I use the ones above and others similar all the time to save me time with commonly typed text, etc. Note that I have them set to send after 3 keypresses as hardly any words I will ever type contain 3 of those letters in succession.
« Last Edit: August 01, 2010, 08:43:47 PM by OkRob »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #8 on: August 01, 2010, 09:03:55 PM »
Is it possible to create a hotkey that does not require simultaneous pressing of keys?

Here's one method to double-tap "k".

Code: Autohotkey
  1. ~k::
  2. {
  3.     {
  4.         MsgBox, Success.
  5.     }
  6. }
  7. Return
  8.  


jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #9 on: August 04, 2010, 05:40:22 AM »
I should have been more specific.  What I want to do is to be able to type kk to simulate control-Alt-F4.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #10 on: August 04, 2010, 05:51:48 AM »
Code: Autohotkey
  1. ~k::
  2. {
  3.     {
  4.         SendInput, ^!{F4}
  5.     }
  6. }
  7. Return
  8.  

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #11 on: August 05, 2010, 03:44:15 PM »
skwire,  That worked like a charm! :Thmbsup:

Can you show me the script to use kj to simulate control-Alt-F4?

Thanks,
jdd

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #12 on: August 07, 2010, 06:43:49 PM »
Mouser,

Can TapTap Hotkey Extender be used to simulate three simultaneous keystrokes such as Ctrl-Alt-F4 by tapping with one hand?  I couldn't seem to get the syntax right in the ini file.

Thanks,
jdd

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #13 on: August 09, 2010, 07:51:21 AM »
Do as OkRob suggested and use a hotstring:

Code: Autohotkey
  1. :*?:kj::
  2. {
  3.     SendInput, ^!{F4}
  4. }
  5. Return
  6.  

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #14 on: August 09, 2010, 03:30:26 PM »
Quote
Can TapTap Hotkey Extender be used to simulate three simultaneous keystrokes
not sure what you are asking -- taptap can't detect a triple tap, only double taps (though this is possibly something that could be added); but it should be able to simulate combinations of 3 or more keys when triggered.

regarding taptap solution vs autohotkey solution, ahk is an incredibly powerful and versatile tool that can do tons of things.
wheras taptap was designed with one thing in mind, detecting these kinds of tapping keypresses as efficiently as possible with smallest impact on cpu and memory and resources.

this is something to care about because these are keypresses that are happening constantly as you type, and you don't want it slowing down your pc.

while i can't say definitively that taptap works more efficiently for this task, that would be my strong suspicion and i'd love to see some benchmarks comparing the two approaches.  though in truth it may be that the impact is minimal, when doing anything but heavy keyboard pounding, if even then.
« Last Edit: August 09, 2010, 03:33:27 PM by mouser »

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #15 on: August 09, 2010, 04:23:43 PM »
skwire, Thank you. That is what I was trying to do.  I am not trying to create hotstrings. 

The reason behind this query is that I am not very adept at using a keyboard.  For me, hot keys that require 3 keys pressed simultaneously (or even two) is very cumbersome.  Since I use a lot of hotkey combinations, the ability to create some using a one-hand 'tap tap' procedure is very powerful. 

Fortunately, I have two hands.  I can see how this would be a great tool for a person with one.

jdd

jdd

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 214
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #16 on: August 09, 2010, 05:44:07 PM »
Mouser,

I am trying to simulate/define hotkeys that normally require simultaneous pressing of three keys (e.g. Ctrl-Alt-Delete).  I would like to launch these hotkeys using a NON-SIMULTANEOUS pressing of two keystrokes. 

So in this example, I would like to define a sequence of two NON-SIMULTANEOUS (e.g. 'k' followed by 'j') to simulate 'Ctrl-Alt-Delete'. Do you follow?

Can I do this in TapTap Hotkey Extender?

OkRob

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Question about AutoHotkey scripting
« Reply #17 on: August 09, 2010, 06:04:42 PM »
If I am interpreting what you wish to do correctly, the script that skwire posted above will do exactly what you wish... hit k, release it then hit j and it will sent Ctrl-Alt-F4. Substitute {Delete} for {F4} and it wll send Ctrl-Alt-Delete if you hit k and then j. I would use a sequence like kkk though, as it's easier to send and a legitimate word containing kkk which would trigger your hotkey is less likely to occur.