Jump to content

Converts punctuation from ASCII code(From VB.net)


Recommended Posts

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 by SomeBody22
Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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

#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 by SomeBody22
Link to comment
Share on other sites

_IsPressed is not the right thing for you. Lookup _WinAPI_SetWindowsHookEx in the help file.

Now you're on your own!

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 here
RegExp tutorial: enough to get started
PCRE 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

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.

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 here
RegExp tutorial: enough to get started
PCRE 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...