flat assembler
Message board for the users of flat assembler.

Index > Windows > Handling mouse, keyboard events FAQ

Author
Thread Post new topic Reply to topic
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
Hi,
I wanted to gather all possible ways of handling different kind of input events in a Win32 program (PE GUI). There are many possibilities to get accelerator keys and single/multiple keys and mouse movement events.
I hope you can all contribute to the search of the best practices in event-handling.

1) Reading [msg.lParam] is only feasible if you have usually one event at a time

2) GetAsyncKey as I understand is a map of keyboard (and mouse) events (and states if you like) but I don't know the memory considerations.

3) Accelerator keys can be assigned by FASM macros when making a dialog, but I haven't gone any deeper assigning them on the fly (like user bindings as you may have seen in some games).

4) What is the best way in games/programs? Polling or event-handling. I think that in games where the CPU is pumping @100% all the time there is no difference, but in passive programs it would be elegant to handle events only when they happen.

It would be nice to have nice and compact API and its usage list by the end of the thread.

_________________
My updated idol Very Happy http://www.agner.org/optimize/
Post 13 Feb 2006, 11:44
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
DirectInput?
Post 13 Feb 2006, 13:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2141
Location: Estonia
Madis731
...and for example what would be the best ways to get:

5) AcceleratorKey combo plus a key (non-blocking, peeking)

6) Series of keys ('c','o','d','e') like in games or a keylock (a state machine)
Post 14 Feb 2006, 22:24
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.