m4tius Posted May 14, 2010 Share Posted May 14, 2010 Could anyone tell me how to bind a shift, alt or ctrl with a function using Hotkey? Any of these doesnt work for me. Link to comment Share on other sites More sharing options...
jfcby Posted May 14, 2010 Share Posted May 14, 2010 Do you mean for example ALT + F11 like the example below.#Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F11 = 0x7A ; Assign "ALT-F11" with Message() and set extended function call _HotKeyAssign(BitOR($CK_ALT, $VK_F11), 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL)) ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Message($iKey) MsgBox(0, 'Hot key Test Message', 'F11 (0x' & Hex($iKey, 4) & ') has been pressed!') EndFunc ;==>Message Func Quit() Exit EndFunc ;==>QuitIf you mean to use the keys ALT, CTRL or SHIFT by themselves to run a function that may not be possible.jfcby Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB **** Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 14, 2010 Share Posted May 14, 2010 (edited) Could anyone tell me how to bind a shift, alt or ctrl with a function using Hotkey?The Send commands listed in the Remarks section there pretty much apply to Hotkey, as to what keys it will accept. Edited May 14, 2010 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
m4tius Posted May 14, 2010 Author Share Posted May 14, 2010 (edited) Im really angry cuz in autohotkey i could bind these keys same like space or letters... But i need it in autoit, it can be any other function however HotKey looks nice. Of course i need these keys only, any other keys with it. Edited May 14, 2010 by m4tius Link to comment Share on other sites More sharing options...
Makaule Posted May 15, 2010 Share Posted May 15, 2010 (edited) Text from Help:This tells AutoIt to send a CONTROL keystroke, therefore Send("^!a") would send "CTRL+ALT+a".N.B. Some programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!You may get more info by entering HotKeySet in search field in Help. Edited May 15, 2010 by Makaule Link to comment Share on other sites More sharing options...
m4tius Posted May 15, 2010 Author Share Posted May 15, 2010 ^ The following hotkeys cannot be set:Alt, Ctrl, Shift, Win These are the modifier keys themselves! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 15, 2010 Share Posted May 15, 2010 The modifiers cannot be set by themselves. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Tvern Posted May 15, 2010 Share Posted May 15, 2010 Depending on what you want to do you could take a look at _IsPressed(), or GUIRegisterMsg($WM_KEYDOWN,"Yourfunc")The first will have to be called in a loop. It doesn't run if the script is inside another function.The second only works inside the scripts GUI I think. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now