1key_shifts(3)                   Allegro manual                   key_shifts(3)
2
3
4

NAME

6       key_shifts  -  Bitmask  containing  the current state of modifier keys.
7       Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       extern volatile int key_shifts;
14

DESCRIPTION

16       Bitmask containing the current state  of  shift/ctrl/alt,  the  special
17       Windows  keys, and the accent escape characters. Wherever possible this
18       value will be  updated  asynchronously,  but  if  keyboard_needs_poll()
19       returns  TRUE, you must manually call poll_keyboard() to update it with
20       the current input state. This can contain any of the flags:
21
22          KB_SHIFT_FLAG
23          KB_CTRL_FLAG
24          KB_ALT_FLAG
25          KB_LWIN_FLAG
26          KB_RWIN_FLAG
27          KB_MENU_FLAG
28          KB_COMMAND_FLAG
29          KB_SCROLOCK_FLAG
30          KB_NUMLOCK_FLAG
31          KB_CAPSLOCK_FLAG
32          KB_INALTSEQ_FLAG
33          KB_ACCENT1_FLAG
34          KB_ACCENT2_FLAG
35          KB_ACCENT3_FLAG
36          KB_ACCENT4_FLAG
37
38       Example:
39
40          if (key[KEY_W]) {
41             if (key_shifts & KB_SHIFT_FLAG) {
42                /* User is pressing shift + W. */
43             } else {
44                /* Hmmm... lower case W then. */
45             }
46          }
47
48

SEE ALSO

50       install_keyboard(3), poll_keyboard(3), key(3), excamera(3), exkeys(3)
51
52
53
54Allegro                          version 4.4.3                   key_shifts(3)
Impressum