hariajay Posted June 6, 2009 Posted June 6, 2009 Hi, What's the key press value for apostrophe (')? Cant seem to find that in the help file. Ajay
Mat Posted June 6, 2009 Posted June 6, 2009 #Include <Misc.au3> While 1 If _Ispressed ("C0") Then MsgBox (0,0,0) Exit EndIf WEnd' MDiesel AutoIt Project Listing
hariajay Posted June 8, 2009 Author Posted June 8, 2009 #Include <Misc.au3> While 1 If _Ispressed ("C0") Then MsgBox (0,0,0) Exit EndIf WEnd' MDiesel Thanks for your reply. I got another query. What is the Code for the the Enter Key in the NumPad?
Mat Posted June 8, 2009 Posted June 8, 2009 even easier!!, it just uses the same as the main one. #Include <Misc.au3> While 1 If _Ispressed ("0D") Then MsgBox (0,0,0) Exit EndIf WEnd MDiesel AutoIt Project Listing
hariajay Posted June 9, 2009 Author Posted June 9, 2009 Thanks for your reply. How to differentiate the Main Enter key press and the NumPad Enter key press?
Malkey Posted June 10, 2009 Posted June 10, 2009 Thanks for your reply. How to differentiate the Main Enter key press and the NumPad Enter key press?This is one way to differentiate which enter key is pressed. This works on my XP. Don't know if it will work with different keyboard layouts and operating systems. ; Global Const $WM_KEYUP = 0x0101 $Gui = GUICreate("Test which enter key is pressed example. (Esc to exit)", 400, 50) GUISetState(@SW_SHOW, $Gui) GUIRegisterMsg($WM_KEYUP, "WindowEvents") While Sleep(150) WEnd Func WindowEvents($hWnd, $Msg, $wParam, $lParam) ;ConsoleWrite(" $hWnd " & $hWnd & " $Msg " & $Msg & " $wParam " & $wParam & " $lParam " & $lParam & @CRLF) Switch $wParam; Virtual key code - a list can be found under _IsPressed(), Help file. Case 0x1b; Esc to exit Exit Case 0x0D; Enter key If BitShift(BitAND($lParam, 0x0F000000), 24) Then; Determined by use of the utility obtained from ; http://www.autoitscript.com/forum/index.php?s=&showtopic=62304&view=findpost&p=466668 MsgBox(0, "", "Num Pad ENTER Pressed") Else MsgBox(0, "", "Main ENTER Pressed, (not the Num Pad one)") EndIf EndSwitch EndFunc ;==>WindowEvents ;
hariajay Posted June 10, 2009 Author Posted June 10, 2009 This is one way to differentiate which enter key is pressed. This works on my XP. Don't know if it will work with different keyboard layouts and operating systems. ; Global Const $WM_KEYUP = 0x0101 $Gui = GUICreate("Test which enter key is pressed example. (Esc to exit)", 400, 50) GUISetState(@SW_SHOW, $Gui) GUIRegisterMsg($WM_KEYUP, "WindowEvents") While Sleep(150) WEnd Func WindowEvents($hWnd, $Msg, $wParam, $lParam) ;ConsoleWrite(" $hWnd " & $hWnd & " $Msg " & $Msg & " $wParam " & $wParam & " $lParam " & $lParam & @CRLF) Switch $wParam; Virtual key code - a list can be found under _IsPressed(), Help file. Case 0x1b; Esc to exit Exit Case 0x0D; Enter key If BitShift(BitAND($lParam, 0x0F000000), 24) Then; Determined by use of the utility obtained from ; http://www.autoitscript.com/forum/index.php?s=&showtopic=62304&view=findpost&p=466668 MsgBox(0, "", "Num Pad ENTER Pressed") Else MsgBox(0, "", "Main ENTER Pressed, (not the Num Pad one)") EndIf EndSwitch EndFunc ;==>WindowEvents ; Thanks for your reply Malkey. Is there a specific code for the Main Enter key and the Numpad Enter Key?
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