IvanHristovYanev Posted November 10, 2012 Share Posted November 10, 2012 How can I insert "numpad 5" but without numpad ON that means "clear KEY" I need to tell a program that i pressed Clear KEY (numpad 5 , but with numpad off) after that i press enter ? Link to comment Share on other sites More sharing options...
water Posted November 10, 2012 Share Posted November 10, 2012 Welcome to AutoIt and the forum!Maybe helps. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 no i want a program to press the clear key ... not me (the user)! Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 how to send ("0C") - clear key to a program ? Link to comment Share on other sites More sharing options...
Tomoya Posted November 12, 2012 Share Posted November 12, 2012 What are you trying to clear? Maybe you could explain to us what you are trying to do or post what you have already done? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 12, 2012 Moderators Share Posted November 12, 2012 (edited) Could always roll your own, maybe something like: Global $gs_AppWindowTitle = "MyApplicationWindowTitle" Global $gh_Hwnd = WinGetHandle($gs_AppWindowTitle) Global $gf_PostMessage = _PostKeyDownMessage($gh_Hwnd, 0x0C) MsgBox(64 + 262144, "Info", "Posted KeyDown 0C = " & ($gf_PostMessage = 1)) Func _PostKeyDownMessage($h_wnd, $i_key) ; wm_keydown = 0x0100 If Not StringIsDigit($i_key) Then If Not StringRegExp($i_key, '^0x|X') Then Return SetError(-1, 0, 0) $i_key = Number($i_key) EndIf Local $a_pm = DllCall('user32.dll', 'int', 'PostMessage', _ 'hwnd', $h_wnd, 'uint', 0x0100, 'wparam', $i_key, 'lparam', 0) If @error Then Return SetError(@error, @extended, False) Return SetError(($a_pm[0] = 0), 0, ($a_pm[0] > 0)) EndFunc Edit: Had 0xC0 and not 0x0C ... oops, sorry . I was testing other key codes: http://msdn.microsoft.com/en-us/library/dd375731%28v=vs.85%29.aspx and lost track of the original intent lol. Edited November 12, 2012 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 ok I will explain.i have a program that ask me to press numpad5(but with numpad off) and then to press enter. Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 HERE IS WHAT I'm DOING WinActivate("Calypso - Избор на маса") WinWaitActive("Calypso - Избор на маса") send("9999") Send('{enter}') WinWaitActive("Calypso") send('9 {enter}') send("{f10}") WinWaitActive('Приключване на сметка') send("{numlock on}") send("{numpadadd}") send("{numpad2}") ;here i need numpad 5 but with numpad turned off sleep(250) send("{numpad5}") Link to comment Share on other sites More sharing options...
Danp2 Posted November 12, 2012 Share Posted November 12, 2012 Since you have numlock on at that point, have you tried this? Send("+{numpad5}") If that doesn't work, have you tried turning off numlock before sending the numpad5 keystroke? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 tried that does not work too .... the two ideas dont work ...the first it sends "5" and the second sends numpad5. Link to comment Share on other sites More sharing options...
IvanHristovYanev Posted November 12, 2012 Author Share Posted November 12, 2012 maybe if someone knows the ascii code of that button it will work Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 12, 2012 Moderators Share Posted November 12, 2012 I've provided the answer. Jos 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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