| | |
Stop a keyboard key input
![]() |
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Solved Threads: 0
Hi, im trying to create a program so that when i hit certian keys on my keyboard it will input the special letters used in the German language. eg "Ä", "Ö" etc...
I have managed to do this with the GetAsyncKeyState and the SendKeys statments, however when i press my key, it displays the original character then the german letter.
Example: one of my selected keys is the "[{" key. when i press it the output displays "[Ä"
How can i stop the original character from inputing? here is an example of my code.
Thanks.
[code] [/Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer]
[code] [/Private Const VK_OEM_4 = &HDB]
[code] [/Private Sub Timer1_Timer()]
[code] [/Dim A As String]
[code] [/A = "Ä"]
[code] [/If GetAsyncKeyState(VK_OEM_4) Then
SendKeys (A)
End If]
[code] [/End Sub]
I have managed to do this with the GetAsyncKeyState and the SendKeys statments, however when i press my key, it displays the original character then the german letter.
Example: one of my selected keys is the "[{" key. when i press it the output displays "[Ä"
How can i stop the original character from inputing? here is an example of my code.
Thanks.
[code] [/Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As
Integer]
[code] [/Private Const VK_OEM_4 = &HDB]
[code] [/Private Sub Timer1_Timer()]
[code] [/Dim A As String]
[code] [/A = "Ä"]
[code] [/If GetAsyncKeyState(VK_OEM_4) Then
SendKeys (A)
End If]
[code] [/End Sub]
HI,
to acheive your task
try the keycode concept
and while posting your code, no need to prefix the code tag in each line,
your code should starts with
with regard s
Venkatramasamy SN
to acheive your task
try the keycode concept
and while posting your code, no need to prefix the code tag in each line,
your code should starts with
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
and ends with
with regard s
Venkatramasamy SN
I know this is a long way coding but if you want you can try it...
1. first is you have to assign all values that corresponds to the key in keyboard
2. get all the keyAscii value of eah key in the keyboard.
3. make a procedure that will get the keyascii value and then put the corresponding german letter.
that's all!
enjoy coding.
regards,
jireh
1. first is you have to assign all values that corresponds to the key in keyboard
2. get all the keyAscii value of eah key in the keyboard.
3. make a procedure that will get the keyascii value and then put the corresponding german letter.
that's all!
enjoy coding.
regards,
jireh
A conclusion is the place where you got tired of thinking. http://www.martin2k.co.uk/forums/index.php?showforum=4
http://www.a1vbcode.com/a1vbcode/vbforums/Forum3-1.aspx
http://www.developerfusion.co.uk/for...orum&ForumID=4
![]() |
Similar Threads
- Run functions while others are running (C)
- Handling keyboard input (C++)
- school project: simple C++ game (need help with keyboard input) (C++)
- can't display the output! can somebody help me?!! PLS.. (C)
- bgates virus+desktop shortcut probs (Viruses, Spyware and other Nasties)
- Hijackthis report, I just don't know (Viruses, Spyware and other Nasties)
- Stopping Hardware (Visual Basic 4 / 5 / 6)
- I lack focus... (Java)
- Zone Alarm Security Alerts. (Viruses, Spyware and other Nasties)
- Apostrophe - How to find the key location. (Windows 95 / 98 / Me)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: problem with quotes in SQL statement
- Next Thread: How close to the edge can you print?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





