ok i want to change the letter that comes out when i press a key any where in my computer.,
lets say i am typing here at vb world, and i type a letter "o", and i want a "0" zero to come out, can this be done????
Printable View
ok i want to change the letter that comes out when i press a key any where in my computer.,
lets say i am typing here at vb world, and i type a letter "o", and i want a "0" zero to come out, can this be done????
bump
Does this help?VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case Asc("o") KeyAscii = Asc("0") End Select End Sub
no, because i am not typing IN my program, i am typing out of it
If macai's suggestion is not what you're after, then I assume you want to re-map your keyboard keys. You could probably write a program to do this using API's - haven't done it before though. I would start looking at the API's that deal with the keyboard.
this is what i orignally asked for.Quote:
Originally posted by BruceG
If macai's suggestion is not what you're after, then I assume you want to re-map your keyboard keys. You could probably write a program to do this using API's - haven't done it before though. I would start looking at the API's that deal with the keyboard.
Oh i see. Well, you see you can use the "GetAsyncKeyState" API
and when the user presses certain buttons, you sayDoes THAT help?VB Code:
'Declares Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer 'When you want to replace o with 0 SendKeys {BS} SendKeys "0" 'Check for the button being pressed If GetAsyncKeyState(Asc("o"))
Sorry i found a couple errors, try this. :oVB Code:
'Declares Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer 'When you want to replace o with 0 SendKeys vbKeyBack SendKeys "0" 'Check for the button being pressed If GetAsyncKeyState(Asc("o")) Then
doesnt sendkeys need a window name to send to?
then i wound need to find what window i am typing in
SendKeys, by default, sends the keys to whatever is the currently
active control. Cool, huh?
If you want to remap your keys just pop them off of your keyboard and move them around :D
Idiot! Just Kidding :)Quote:
Originally posted by goudabuddha
If you want to remap your keys just pop them off of your keyboard and move them around :D