MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

Bluescreen
MAME Fan
Reged: 04/23/06
Posts: 4
Send PM


Accessing keyboard under WinXP
#72105 - 04/23/06 07:49 PM


Hi,

I want to build my own small frontend for MAME. But I don't know how to do non-blocking keyboard and mouse requests on Windows XP. I am an old Saurier who can only code in C, without classes and other high sophisticated things. To my time you used kbhit, getch and sleep. All of them gone now. Now we have Megabytes of DirectX, but how to use them.

Is there anybody wo like to give me some hints? If it is offtopic here you can contact me personally at hugo.simon(at)gmx.de.

Thank you anybody

Bluescreen



twistyAdministrator
Space Lord
Reged: 09/18/03
Posts: 15570
Send PM


Re: Accessing keyboard under WinXP new [Re: Bluescreen]
#72115 - 04/23/06 09:46 PM


> If it is offtopic here you can
> contact me personally at hugo.simon(at)gmx.de.

This is a general programming forum, it's very much on-topic and all such posts are welcomed






R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9711
Loc: ECV-197 The Orville
Send PM


Re: Accessing keyboard under WinXP new [Re: Bluescreen]
#72215 - 04/24/06 10:11 PM


> I want to build my own small frontend for MAME. But I don't know how to do
> non-blocking keyboard and mouse requests on Windows XP. I am an old Saurier who can
> only code in C, without classes and other high sophisticated things. To my time you
> used kbhit, getch and sleep. All of them gone now. Now we have Megabytes of DirectX,
> but how to use them.

Depends which way you're going. For a full-screen app like MAME itself, I strongly recommend using the SDL wrapper library (www.libsdl.org). It uses DirectX internally but presents a very easy to learn plain C API (and as a bonus programs written with it also can work unchanged on Linux and MacOSX).

If you're looking to do a windowed front end similar to MAME32 then you need the Petzold book. In English, that's "Programming Windows, Fifth Edition" by Charles Petzold, published by Microsoft Press. It is *the* Bible on plain-C Win32 programming.

Edited by R. Belmont (04/24/06 10:21 PM)



ikk
MAME Fan
Reged: 11/15/06
Posts: 2
Send PM


Re: Accessing keyboard under WinXP new [Re: Bluescreen]
#93491 - 11/15/06 05:37 PM


> Hi,
>
> I want to build my own small frontend for MAME. But I don't know how to do
> non-blocking keyboard and mouse requests on Windows XP. I am an old Saurier who can
> only code in C, without classes and other high sophisticated things. To my time you
> used kbhit, getch and sleep. All of them gone now. Now we have Megabytes of DirectX,
> but how to use them.
>
> Is there anybody wo like to give me some hints? If it is offtopic here you can
> contact me personally at hugo.simon(at)gmx.de.
>
> Thank you anybody
>
> Bluescreen

if you have windows.h included you can use GetKeyState() to get state of desired key, search msdn.com for it. this function allows to get state of a key at the moment function is called.
there are also window messages WM_KEYDOWN and WM_KEYUP, send to window with keyboard focus.


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 2 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3631