Click here to Skip to main content
15,905,682 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I determine the key press in a specific place on the screen?


What I have tried:

    <DllImport("user32.dll")>
    Private Shared Function keybd_event(bVk As Byte, bScan As Byte, dwFlags As UInteger, dwExtraInfo As Integer) As Boolean
    End Function
Const KEYEVENTF_KEYDOWN = &H0
    Const KEYEVENTF_KEYUP = &H2
Posted
Updated 6-Sep-21 17:01pm

Key press does not happen in a specific location. Instead when you press a key, it's sent to the application which has the focus, and in that application to the form and control which have the focus.
 
Share this answer
 
How do I use  Location = New Point(950, 330)  in keybd_event
 
Share this answer
 
Comments
Richard MacCutchan 7-Sep-21 3:14am    
You don't; screen location is only relevant to mouse click events.
Richard Deeming 7-Sep-21 3:52am    
In what way is this additional question supposed to be a "solution" to your original question?
Mohenad Essam 7-Sep-21 5:46am    
I want to control the keyboard keys like panels KeyMapping gaming

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900