Re: [gtkmm] Q: keystroke interception
- From: Paul Davis <paul linuxaudiosystems com>
- To: brian b mcguinness lmco com
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] Q: keystroke interception
- Date: Wed, 07 Jul 2004 08:14:51 -0400
>support for Unicode. Basically, I want to read keystrokes in
>raw mode, determine whether or not the Control or Alt key
>was pressed along with the keystroke, and act accordingly.
All X Window applications work this way because its the way X Window
works. You get "events" telling you of individual key presses,
including those involving modifier keys. If modifier keys are held
down while pressing other keys, the "state" field of the event is set
to a bitmask that describes which modifier keys are held down.
So If the user presses Ctrl-A, you will get
key press event (Control), state = 0
Key press event (A), state = <non-zero>
when they release the keys, you will get either
key release event (A), state = <non-zero>
key release event (Control), state = 0
or
key release event (Control), state = <non-zero>
key release event (A), state = 0
depending on the order.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]