AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Press any key to Continue

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
larl47303
Guest





PostPosted: Fri Mar 11, 2005 9:24 pm    Post subject: Press any key to Continue Reply with quote

I am sure that this is possible although I am having difficulty figuring it out

I would like to be able to use this in a script

Thanks in Advance

LarryB
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sat Mar 12, 2005 2:25 am    Post subject: Reply with quote

Assuming a simple "MsgBox Press OK to continue" isn't enough:

Although it doesn't work on Windows 9x, the Input command is the purest way to do this:
Code:
#space::  ; Win+Space hotkey.
Input, SingleKey, L1, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}
MsgBox You pressed a key.
return

The above lists most non-character keys (such as the modifier keys and arrow keys) as "end keys" because such keys are not captured otherwise.
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 4016
Location: Pittsburgh

PostPosted: Sat Mar 12, 2005 3:16 am    Post subject: Reply with quote

We can add a few more endkeys, and let them be shown in the MsgBox. {ScrollLock} is the only standard key, which does not seem to show up. (Maybe my KVM switch catches it?) This script is a fast way to find the keynames.
Code:
#Space::
Input, Key, L1, {ScrollLock}{CapsLock}{NumLock}{TAB}{Esc}{BS}{Enter}{PrintScreen}{Pause}{LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}
IfEqual Key,, StringTrimLeft, Key, ErrorLevel, 7
MsgBox You pressed the »%Key%« key
return
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group