The Be Book Keyboard Keyboard Index

Keyboard Messages


B_KEY_DOWN , B_KEY_UP , B_UNMAPPED_KEY_DOWN , B_UNMAPPED_KEY_UP

Source: The system.
Target: The focus view's BWindow.
Hook: BView::KeyDown() (B_KEY_DOWN)
BView::KeyUp() (B_KEY_UP)
(The ...UNMAPPED... messages don't map to hook functions.)

B_KEY_DOWN is sent when the user presses (or holds down) a key that's mapped to a character; B_KEY_UP is sent when the user releases the key. B_UNMAPPED_KEY_DOWN and B_UNMAPPED_KEY_UP are sent if the key isn't mapped to a character. This doesn't include modifier keys, which are reported in the B_MODIFIERS_CHANGED message.

Field Type code Description
"when" B_INT64_TYPE Event time, in microseconds since 01/01/70
"key" B_INT32_TYPE The code for the physical key that was pressed. See "More on Keyboard Mapping" for a discussion of the keymap.
"be:key_repeat"
(B_KEY_DOWN only)
B_INT32_TYPE The "iteration number" of this key down. When the user holds the key down, successive messages are sent with increasing key repeat values. This field isn't present in the initial event; the first repeat message (i.e., the second key down message) has a key repeat value of 1.
"modifiers" B_INT32_TYPE The modifier keys that were in effect at the time of the event. See "Modifier Keys" for a list of values.
"states" B_UINT8_TYPE The state of all keys at the time of the event. See "Key States."
"byte" [3]
(B_KEY_DOWN and B_KEY_UP only)
B_INT8_TYPE The UTF8 data that's generated
"bytes"
(B_KEY_DOWN and B_KEY_UP only)
B_STRING_TYPE The string that's generated. (The string usually contains a single character.)
"raw_char"
(B_KEY_DOWN and B_KEY_UP only)
B_INT32_TYPE Modifier-independent ASCII code for the character.


B_KEY_UP see B_KEY_DOWN
B_UNMAPPED_KEY_UP see B_KEY_DOWN


B_MODIFIERS_CHANGED

Source: The system.
Target: The focus view's window.

Sent when the user presses or releases a modifier key.

Field Type code Description
"when" B_INT64_TYPE Event time, in microseconds since 01/01/70
"modifiers" B_INT32_TYPE The current modifier keys. See "Modifier Keys" for a list of values.
"be:old_modifiers" B_INT32_TYPE The previous modifier keys.
"states" B_UINT8_TYPE The state of all keys at the time of the event. See "Key States.".


The Be Book Keyboard Keyboard Index

The Be Book,
...in lovely HTML...
for BeOS Release 5.

Copyright © 2000 Be, Inc. All rights reserved..