The Input Server: Input Server Structures and Constants

The Input Server Table of Contents | The Input Server Index

# Input Server Structures and Constants

## Structures

### input_device_ref

Declared in: be/add-ons/input_server/InputServerDevice.h

struct `input_device_ref` {
char *name;
input_device_type type;
void *cookie;
}

The `input_device_ref` structure is used to identify specific devices that a BInputServerDevice manages. To tell the Input Server about the devices your object manages, you create an array of these structures and pass them in a `BInputServerDevice::RegisterDevices()` call.

The fields are:

Field | Meaning
--- | ---
const char *`name` | An arbitrary—but preferably human-readable—name that you invent. Although the name is used as an identifier (in `Control()` calls), you should choose a name that's "UI-suitable" (e.g. "ADB Mouse", or "USB Keyboard").
input_device_type `type` | This is either `B_POINTING_DEVICE` (i.e. mice), `B_KEYBOARD_DEVICE`, or `B_UNDEFINED_DEVICE`, where the last of these is a catchall for anything that isn't a mouse or a keyboard.
void *`cookie` | This is an arbitrary piece of data that you can associate with the device. Use it to conveniently store some cogent piece of data (such as *`this`), or to more specifically identify the device (such as the pathname of the driver it corresponds to), and so on.

## Constants

### Device Types

Declared in: be/interface/Input.h

`B_POINTING_DEVICE `
`B_KEYBOARD_DEVICE `
`B_UNDEFINED_DEVICE `

These constants represent the different types of input devices; they're used when defining an `input_device_ref` structure, and when sending control messages through a BInputDevice object.

- `B_POINTING_DEVICE` signifies devices, such as mice and tablets, that are used to control the cursor.

- `B_KEYBOARD_DEVICE` signifies keyboards.

- `B_UNDEFINED_DEVICE` is anything that isn't a pointer or keyboard.

| Note that there is no "joystick device"—the Input Server doesn't currently handle joysticks.

### Input , Method , Operations

Declared in: be/interface/Input.h

enum `input_method_op` {
`B_INPUT_METHOD_STARTED`,
`B_INPUT_METHOD_STOPPED`,
`B_INPUT_METHOD_CHANGED`,
`B_INPUT_METHOD_LOCATION_REQUEST
` }

### Input , Device , Notifications

Declared in: be/interface/Input.h

enum `input_device_notification` {
`B_INPUT_DEVICE_ADDED`,
`B_INPUT_DEVICE_STARTED`,
`B_INPUT_DEVICE_STOPPED`,
`B_INPUT_DEVICE_REMOVED
` }

### Input , Device , Control , Messages

Declared in: be/add-ons/input_server/InputServerDevice.h

`B_KEY_MAP_CHANGED `
`B_KEY_LOCKS_CHANGED `
`B_KEY_REPEAT_DELAY_CHANGED `
`B_KEY_REPEAT_RATE_CHANGED `
`B_MOUSE_TYPE_CHANGED `
`B_MOUSE_MAP_CHANGED `
`B_MOUSE_SPEED_CHANGED `
`B_CLICK_SPEED_CHANGED `

These constants are used in the `BInputServerDevice::Control()` function to tell a BInputServerDevice that a change to a device parameter has been requested.

The Input Server Table of Contents | The Input Server Index

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

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