Again :D Me need help :/

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
12 posts Page 1 of 2
Contributors
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Again :D Me need help :/
M1z23R
I read 20 forums along with MSDN site, and still nothing, how do you I use "SendKeys.Send" with NUMPAD numbers ? It says use this
Code: Select all
SendKeys.Send "{NUMPAD9}"
dont know why, but it is not working, it says Wrong key, something like that
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

Re: Again :D Me need help :/
smashapps
SendKeys.Send(Keys.NumPad0)

try that
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
Vikhedgehog
VIP - Donator
VIP - Donator
Posts: 812
Joined: Fri Nov 05, 2010 6:24 pm

Re: Again :D Me need help :/
Vikhedgehog
Code: Select all
SendKeys.Send "{NUMPAD9}"
Maybe try
Code: Select all
SendKeys.Send("{NUMPAD9}")
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Again :D Me need help :/
Axel
Nope won't change a bit
http://vagex.com/?ref=25000
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

Re: Again :D Me need help :/
smashapps
my one should work fine
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Again :D Me need help :/
M1z23R
It should but it doesn't '-.- you can try it :/

It sends for example if i set keys.numpad0 it sends "96"
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Again :D Me need help :/
M1z23R
Finally found it :/ Had to use APIs
Code: Select all
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const KEYEVENTF_KEYUP As Long = &H2
Private Const KEYEVENTF_EXTENDEDKEY As Long = &H1

Const VK_MENU = &H12 'ALT
Const VK_NUMPAD0 = &H60

Private Sub PressKey
  keybd_event VK_NUMPAD0, 0, KEYEVENTF_KEYUP, 0  ' release 0
  keybd_event VK_NUMPAD0, 0, 0, 0  ' press 3
End Sub

User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Again :D Me need help :/
mandai
You can't send a numpad key using SendKeys.SendWait because there is no single character or key sequence to represent one of these keys.

You would have to simulate the key press in order to get the matching result.
User avatar
upperdrag
Excellent Poster
Excellent Poster
Posts: 321
Joined: Fri Mar 12, 2010 12:05 pm

Re: Again :D Me need help :/
upperdrag
*bump* how can i tweak this so it works for other numpads too? And modify so i can have multiple numpad event under a single event? Like when i press f5, it will push numpad 2 and when i press f4 it will push numpad 3
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Again :D Me need help :/
mandai
You can specify the other numpad keycodes in the bScan paramater.

GetAsyncKeyState and RegisterHotKey can be used for hotkey support.
12 posts Page 1 of 2
Return to “Tutorial Requests”