Message Constants

Input Device Event Messages

Pointing Device Event Messages

  • MOUSE()

  • MOUSE()

  • MOUSE()

Note that a pointing device isn’t expected to send the B_MOUSE_ENTER_EXIT message.

Keyboard Device Event Messages

  • B_KEY_DOWN

  • B_UNMAPPED_KEY_DOWN

  • B_KEY_UP

  • B_UMAPPED_KEY_UP

  • B_MODIFIERS_CHANGED

Input Device Control Messages

Pointing Device Control Messages

Constant

Description

B_CLICK_SPEED_CHANGED

Requests that the receiver change the mouse double-click speed to the value retrieved through click().

B_MOUSE_MAP_CHANGED

Requests that the receiver change the mouse map (the correspondence between physical mouse buttons and the B_PRIMARY_MOUSE_BUTTON, et. al., constants) to the map retrieved through mouse().

B_MOUSE_SPEED_CHANGED

Requests that the receiver change the mouse speed to the value retrieved through mouse().

B_MOUSE_TYPE_CHANGED

Requests that the receiver change the mouse type (the number of buttons) to the type retrieved through mouse().

Keyboard Device Control Messages

Constant

Description

B_KEY_LOCKS_CHANGED

Requests that the receiver change the state of the locked keys (caps lock, num lock, etc.). To get the desired state of the locking keys, read the states out of the key map returned by key().

B_KEY_MAP_CHANGED

Requests that the receiver change the keyboard’s key map—the mapping between physical keys and the character codes they generate. The new key map is returned by key().

B_KEY_REPEAT_DELAY_CHANGED

Requests that the receiver change the delay before a held key starts generating repeated characters to the value retrieved through key().

B_KEY_REPEAT_RATE_CHANGED

Requests that the receiver change the speed at which a held key generates repeated characters to the value retrieved through key().

Device Monitoring

The input() function lets you ask the Input Server to send you a message when a device starts or stops, or when the set of registered devices changes. These “device monitoring” notifications are sent to the target specified in the function. The command constant is always B_INPUT_DEVICES_CHANGED. The be:opcode field will be one of:

Constant

Description

B_INPUT_DEVICE_ADDED

An input device has been added to the system.

B_INPUT_DEVICE_REMOVED

An input device has been removed from the system.

B_INPUT_DEVICE_STARTED

An input device has been started.

B_INPUT_DEVICE_STOPPED

An input device has been stopped.

Input Method Events

Active input methods send input method events (B_INPUT_METHOD_EVENT messages) downstream to application views to help integrate the method’s work with the view’s display. Inside each B_INPUT_METHOD_EVENT message is a be:opcode field indicating the type of input method event:

Constant

Description

B_INPUT_METHOD_CHANGED

Sent whenever the user changes the text during an input transaction.

B_INPUT_METHOD_LOCATION_REQUEST

Sent whenever the input method needs to know the on-screen locations of characters in the input transaction.

B_INPUT_METHOD_STARTED

Sent when a new input transaction is beginning.

B_INPUT_METHOD_STOPPED

Sent when an input transaction is completed.