Macros for key codes and shift status
[Macros and data types commonly used]

Defines


Define Documentation

#define KS_ALT   0x0000000C

This status indicate that either the left-Alt key or the right-Alt key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1158 of file common.h.

#define KS_CAPSLOCK   0x00000100

This status indicate that the CapsLock key was locked when the key or mouse message posted to the window.

You can test the status by AND'ed with lParam of the message, like below

      switch (message) {
      case MSG_KEYDOWN:
          if (lParam & KS_CAPSLOCK) {
              // the CapsLock key is locked.
              ...
          }
          break;
      ...
See also:
Key event messages

Definition at line 1086 of file common.h.

#define KS_CAPTURED   0x00000400

This status indicate that the mouse is captured by a window when the mouse message posted.

You can test the status by AND'ed with wParam of the message, like below:

      switch (message) {
      case MSG_MOUSEMOVE:
          if (wParam & KS_CAPTURED) {
              // the mouse is captured by this window.
              ...
          }
          break;
      ...
See also:
Mouse event messages

Definition at line 1056 of file common.h.

#define KS_CTRL   0x00000030

This status indicate that either the left-Ctrl key or the right-Ctrl key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1131 of file common.h.

#define KS_IMEPOST   0x00000200

This status indicate that the key message is posted by the IME window.

See also:
Key event messages

Definition at line 1064 of file common.h.

#define KS_LEFTALT   0x00000008

This status indicate that left-Alt key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1140 of file common.h.

#define KS_LEFTBUTTON   0x00001000

This status indicate that left button was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1200 of file common.h.

#define KS_LEFTCTRL   0x00000020

This status indicate that the left-Ctrl key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1113 of file common.h.

#define KS_LEFTSHIFT   0x00000002

This status indicate that left-Shift key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1167 of file common.h.

#define KS_MIDDLBUTTON   0x00004000

This status indicate that middle button was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1218 of file common.h.

#define KS_NUMLOCK   0x00000080

This status indicate that the NumLock key was locked when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1095 of file common.h.

#define KS_REPEATED   0x00000800

This status indicate that the key down message is an auto-repeated one.

You can test the status by AND'ed with lParam of the message, like below:

      switch (message) {
      case MSG_KEYDOWN:
          if (lParam & KS_REPEATED) {
              // the key down messsage is auto-repeated.
              ...
          }
          break;
      ...
See also:
Key event messages

Definition at line 1034 of file common.h.

#define KS_RIGHTALT   0x00000004

This status indicate that right-Alt key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1149 of file common.h.

#define KS_RIGHTBUTTON   0x00002000

This status indicate that right button was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1209 of file common.h.

#define KS_RIGHTCTRL   0x00000010

This status indicate that the right-Ctrl key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1122 of file common.h.

#define KS_RIGHTSHIFT   0x00000001

This status indicate that right-Shift key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1176 of file common.h.

#define KS_SCROLLLOCK   0x00000040

This status indicate that the ScrollLock key was locked when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1104 of file common.h.

#define KS_SHIFT   0x00000003

This status indicate that either the left-Shift key or the right-Shift key was pressed when the key or mouse message posted to the window.

See also:
Key event messages

Definition at line 1185 of file common.h.

#define MASK_KS_BUTTONS   0x0000F000

The mask of mouse button status.

Definition at line 1224 of file common.h.

#define MASK_KS_SHIFTKEYS   0x00000FFF

The mask of key status.

Definition at line 1191 of file common.h.

#define MGUI_NR_KEYS   255

Number of MiniGUI keys.

The number of MiniGUI keys is defined to 255 by default. This means that MiniGUI can destinguish 255 different keys with each has an unique scan code. The scan codes below 129 are defined for PC keyboard by default. If your system has a large amount of keys, you can define the scan code of keys ranged from 1 to 255 in your IAL engine. And your application will receive a MSG_KEYDOWN and MSG_KEYUP messages when a key pressed and released, and the wParam of the messages will be defined to be equal to the scan code of the key.

See also:
NR_KEYS, SCANCODE_USER

Definition at line 833 of file common.h.

#define NR_KEYS   128

The number of keys defined by Linux operating system.

For a PC box, NR_KEYS is defined to 128 by default. You can define some input events from an input device other than keyboard, e.g. your remote controller, as key events with different scan codes from those of PC's. MiniGUI can support 255 keys, and the constant is defined by MGUI_NR_KEYS.

See also:
MGUI_NR_KEYS

Definition at line 848 of file common.h.

#define SCANCODE_USER   (NR_KEYS + 1)

The first key scan code different from OS defined ones.

You can define your special key scan codes like below

 #define SCANCODE_PLAY    (SCANCODE_USER)
 #define SCANCODE_STOP    (SCANCODE_USER + 1)
 #define SCANCODE_PAUSE   (SCANCODE_USER + 2)

to distinguish the keys on your remote controller.

See also:
MGUI_NR_KEYS, NR_KEYS

Definition at line 867 of file common.h.

Generated on Thu Apr 7 15:55:33 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3