int_register keyboard_console
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

keyboard

Description
Interface implemented by keyboard controllers. Used by consoles to send keyboard events to the controller.

The function keyboard_event() takes the keyboard controller as its first argument obj. The key_up argument specifies whether the event is a key release (1) or a key press (0). The key argument is the Simics internal keycode, as defined in the sim_key_t enum.

If the return value is 1 the keyboard controller accepted the event. If return value is 0 the keyboard controller did not accept the event, and the console should buffer the event until it gets a keyboard_ready() call from the keyboard controller.

SIM_INTERFACE(keyboard) {
        int (*keyboard_event)(conf_object_t *obj, int key_up, uint8 key);
};

#define KEYBOARD_INTERFACE "keyboard"

Execution Context
Cell Context for all methods.

int_register keyboard_console