SomeBody22 Posted May 27, 2012 Share Posted May 27, 2012 (edited) Hello, Ineed a function like the one below(VB.net), which convertsextended characters to standard(printable Characters/Punctuation):CType(ConvertPunct(i), Char)Example: While 1 For $i = 150 To 190 If $i = 162 Then ConsoleWrite("LControl") ElseIf $i = 163 Then ConsoleWrite("RControl") ElseIf $i = 188 Then ConsoleWrite(","); 188 should be 44(,) ElseIf $i = 189 Then ConsoleWrite("-"); -(Hyphen Key) = BD(Hex) = 189(Dec on Extended Character ANSII) = 45(Dec on ASCII) ElseIf $i = 190 Then ConsoleWrite("."); .(Period Key) = BE(Hex) = 190(Dec on Extended Character ANSII) =46(Dec on ASCII) ;[Continued ...] EndIf Next Sleep(1) WEnd Edited May 27, 2012 by SomeBody22 Link to comment Share on other sites More sharing options...
jchd Posted May 27, 2012 Share Posted May 27, 2012 Can you explain where you got those decimal values from? They don't match common character sets. Corollary: what's your locale? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
SomeBody22 Posted May 27, 2012 Author Share Posted May 27, 2012 (edited) #include <Misc.au3> While 1 For $i = 0 To 190 $a_Result = _IsPressed(Hex($i)) If $a_Result = 1 Then If $i = 162 Then ConsoleWrite("LControl") ElseIf $i = 163 Then ConsoleWrite("RControl") ElseIf $i = 188 Then ConsoleWrite(","); 188 should be 44(,) ElseIf $i = 189 Then ConsoleWrite("-"); -(Hyphen Key) = BD(Hex) = 189(Dec on Extended Character ANSII) = 45(Dec on ASCII) ElseIf $i = 190 Then ConsoleWrite("."); .(Period Key) = BE(Hex) = 190(Dec on Extended Character ANSII) = 46(Dec on ASCII) Else ConsoleWrite("Pressed key: " & Chr($i) & @CRLF); ;[Continued ...] EndIf EndIf Next WEnd I need make a macro to do that, soon after pressing a key with punctuation he must recognize and record the key to later be used at the time of reproduction, currently, isn't recognizing properly the key pressed. And I don't want to bind the keys with the HotKeySet. Edited May 27, 2012 by SomeBody22 Link to comment Share on other sites More sharing options...
jchd Posted May 28, 2012 Share Posted May 28, 2012 _IsPressed is not the right thing for you. Lookup _WinAPI_SetWindowsHookEx in the help file. Now you're on your own! SomeBody22 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
SomeBody22 Posted May 28, 2012 Author Share Posted May 28, 2012 Thank you very much, _WinAPI_SetWindowsHookEx is really better than _IsPressed in this case... But the dilemma remains, how to convert a Virtual-Key into a character ASCII(easily)? Link to comment Share on other sites More sharing options...
jchd Posted May 28, 2012 Share Posted May 28, 2012 Use the vkCode element from the structure $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) in the callback procedure you register. This is the extended ASCII character code, and some extra codes for special keys, which you can find on MSDN after searching for vkCode. As I said I've good reason to keep my hints a bit cryptic. There's some potential here we don't want to discuss for obvious reasons. SomeBody22 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
SomeBody22 Posted May 29, 2012 Author Share Posted May 29, 2012 (edited) Thanks again.I managed to solve using "GetKeyState" and "GetKeyNameText". Edited May 29, 2012 by SomeBody22 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