Tscope5
keyboard.c File Reference

Definitions of keyboard functions. More...

Go to the source code of this file.

Functions

Response registration

The keyboard can be used as a response device.

See timer.c for more information about response registration.

The keyboard can also be used for scanf type input. See textio.c for more information about scanf type input.

int ts5_define_keyboard_button (int button)
 Define a keyboard button as a response button. More...
 
int ts5_get_num_keyboard_buttons ()
 Get the number of buttons available on the keyboard. More...
 

Detailed Description

Definitions of keyboard functions.

Definition in file keyboard.c.

Function Documentation

int ts5_define_keyboard_button ( int  button)

Define a keyboard button as a response button.

Parameters
buttonNumber of the button (buttons are counted from 1).
Returns
The reponse number associated with the button.

Possible button values are:

  • TS5_KEY_A, TS5_KEY_B, TS5_KEY_C, TS5_KEY_D, TS5_KEY_E, TS5_KEY_F, TS5_KEY_G, TS5_KEY_H, TS5_KEY_I, TS5_KEY_J TS5_KEY_K, TS5_KEY_L, TS5_KEY_M, TS5_KEY_N, TS5_KEY_O, TS5_KEY_P, TS5_KEY_Q, TS5_KEY_R, TS5_KEY_S, TS5_KEY_T, TS5_KEY_U, TS5_KEY_V, TS5_KEY_W, TS5_KEY_X, TS5_KEY_Y, TS5_KEY_Z
  • TS5_KEY_0, TS5_KEY_1, TS5_KEY_2, TS5_KEY_3, TS5_KEY_4, TS5_KEY_5, TS5_KEY_6, TS5_KEY_7, TS5_KEY_8, TS5_KEY_9
  • TS5_KEY_PAD_0, TS5_KEY_PAD_1, TS5_KEY_PAD_2, TS5_KEY_PAD_3, TS5_KEY_PAD_4, TS5_KEY_PAD_5, TS5_KEY_PAD_6, TS5_KEY_PAD_7, TS5_KEY_PAD_8, TS5_KEY_PAD_9
  • TS5_KEY_F1, TS5_KEY_F2, TS5_KEY_F3, TS5_KEY_F4, TS5_KEY_F5, TS5_KEY_F6, TS5_KEY_F7, TS5_KEY_F8, TS5_KEY_F9, TS5_KEY_F10, TS5_KEY_F11, TS5_KEY_F12
  • TS5_KEY_ESCAPE, TS5_KEY_TILDE, TS5_KEY_MINUS, TS5_KEY_EQUALS, TS5_KEY_BACKSPACE, TS5_KEY_TAB, TS5_KEY_OPENBRACE, TS5_KEY_CLOSEBRACE, TS5_KEY_ENTER, TS5_KEY_SEMICOLON, TS5_KEY_QUOTE, TS5_KEY_BACKSLASH, TS5_KEY_BACKSLASH2, TS5_KEY_COMMA, TS5_KEY_FULLSTOP, TS5_KEY_SLASH, TS5_KEY_SPACE
  • TS5_KEY_INSERT, TS5_KEY_DELETE, TS5_KEY_HOME, TS5_KEY_END, TS5_KEY_PGUP, TS5_KEY_PGDN, TS5_KEY_LEFT, TS5_KEY_RIGHT, TS5_KEY_UP, TS5_KEY_DOWN
  • TS5_KEY_PAD_SLASH, TS5_KEY_PAD_ASTERISK, TS5_KEY_PAD_MINUS, TS5_KEY_PAD_PLUS, TS5_KEY_PAD_DELETE, TS5_KEY_PAD_ENTER, TS5_KEY_PRINTSCREEN, TS5_KEY_PAUSE
  • TS5_KEY_ABNT_C1, TS5_KEY_YEN, TS5_KEY_KANA, TS5_KEY_CONVERT, TS5_KEY_NOCONVERT, TS5_KEY_AT, TS5_KEY_CIRCUMFLEX, TS5_KEY_COLON2, TS5_KEY_KANJI
  • TS5_KEY_PAD_EQUALS, TS5_KEY_BACKQUOTE, TS5_KEY_SEMICOLON2, TS5_KEY_COMMAND, TS5_KEY_BACK
    • TS5_KEY_LSHIFT, TS5_KEY_RSHIFT, TS5_KEY_LCTRL, TS5_KEY_RCTRL, TS5_KEY_ALT, TS5_KEY_ALTGR, TS5_KEY_LWIN, TS5_KEY_RWIN, TS5_KEY_MENU, TS5_KEY_SCROLLLOCK, TS5_KEY_NUMLOCK, TS5_KEY_CAPSLOCK

Give a positive number if you want to monitor button press events, a negative number if you want to monitor button release events.

Warning
Mac OS X makes no difference between the left and right versions of the shift, control and alt buttons.
Examples:
audio03.c, audio04.c, keyboard01.c, timer03.c, timer04.c, timer05.c, and timer06.c.

Definition at line 88 of file keyboard.c.

int ts5_get_num_keyboard_buttons ( )

Get the number of buttons available on the keyboard.

Returns
The number of buttons on the keyboard.

This value is constant, irrespective of the actual number of buttons on the keyboard.

Examples:
keyboard01.c.

Definition at line 151 of file keyboard.c.