|
|
|
| Web Hosting Guide |
![]() ![]() |
Programatically Holding Down Keys |
May 5 2008, 06:26 AM
Post
#1
|
|
|
Premium Member Group: [HOSTED] Posts: 447 Joined: 16-February 06 From: Kolkata, India Member No.: 11,322 myCENTs:81.67 |
I am working on some new interactivity effects for Pika Bot. These will allow Pika Bot to Hold Down/Release Keys. I know it has to be done using the Windows API but am at a loss when trying to figure out the SendInput function and its usage. Can anybody help me out on getting this done using C# or VB .NET?
|
|
|
|
May 5 2008, 12:23 PM
Post
#2
|
|
|
Super Member Group: [HOSTED] Posts: 500 Joined: 5-November 06 Member No.: 17,016 myCENTs:79.88 |
I don't think SendInput will work. It's for sending keystrokes. I've look into
WM_KEYDOWN - http://msdn.microsoft.com/en-us/library/ms646280(VS.85).aspx and keybd_event of user32.dll - http://www.devx.com/vb2themax/Tip/19094 The 2nd example is for VB6, i believe it's not too hard to convert to vb.net. From there converting to c# is a lot easier. WM_KEYDOWN will require you to use SendMessage or PostMessage API to send the key, read the MSDN doc for the details. If you need to know p/invoke for any particular API, goto http://www.pinvoke.net/ They have the declaration for vb.net and c# there. If the above don't works and you need a much lower level of sending keys, you might want to look into SetWindowsHookEx and WH_KEYBOARD_LL. These are for hooking up low level key press like alt+ctrl+del where you can never receive such event from the system in your normal app. From there, you can know how the message system works, and how to emulate ones Let me know if you need more help, I can free sometime to try out some code later Good Luck |
|
|
|
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
11 | helix | 1,982 | 27th January 2010 - 11:36 AM Last post by: iG-Bungee |
|||
![]() |
6 | intrepid | 5,455 | 3rd December 2009 - 07:07 PM Last post by: iG-Jessica Tanenhaus |
|||
![]() |
2 | dserban | 853 | 9th September 2007 - 08:46 PM Last post by: wutske |
|||
![]() |
3 | Zeeshan Hashmi | 4,452 | 21st March 2007 - 06:39 AM Last post by: Atomic0 |
|||
![]() |
8 | ginginca | 1,718 | 19th February 2007 - 11:47 AM Last post by: ginginca |
|||
![]() |
1 | DjCalvin | 3,219 | 10th May 2006 - 02:42 PM Last post by: miCRoSCoPiC^eaRthLinG |
|||
![]() |
2 | tansqrx | 855 | 13th February 2006 - 03:33 AM Last post by: funkyfresh |
|||
|
Lo-Fi Version | Time is now: 20th March 2010 - 03:03 PM |
© 2010 AstaHost: Free Web Hosting & Technical Discussion, Free Web Hosting. a member of xisto.
Powered by Invision Board. Skin: IPB Forum Skins
Expand / Collapse Navigation



May 5 2008, 06:26 AM





