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 

sending keystrokes based on the application focused.

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





PostPosted: Sun Jul 27, 2008 3:59 am    Post subject: sending keystrokes based on the application focused. Reply with quote

if I'm using for example plsql developer I want to send "select * from" for the "s" key, while others do nothing.

How can I identify the application currently using and make the script.

Thanks.
Back to top
Icarus



Joined: 24 Nov 2005
Posts: 507

PostPosted: Sun Jul 27, 2008 6:49 am    Post subject: Reply with quote

use #IfWinActive <title of your application> before your shortcuts.
You may want to change the title match mode, using SetTitleMatchMode, or for a higher accuracy, you may want to use the Windows Spy to determine your windows class, and use it instead.

The following two codes do the work for Firefox for example:
Code:

SetTitleMatchMode RegEx

#IfWinActive .*Firefox.*
F12::SoundPlay *64


Code:

#IfWinActive ahk_class MozillaUIWindowClass
F12::SoundPlay *64

_________________
Sector-Seven (Music and Utilities)
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sun Jul 27, 2008 4:10 pm    Post subject: Reply with quote

also note that you only need #ifWinactive once for each group of hotkeys. you don't have to put it before every hotkey.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
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