Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
keyboard_seteventhandler(3)   Svgalib User Manual  keyboard_seteventhandler(3)

NAME
       keyboard_seteventhandler,  keyboard_setdefaulteventhandler  - define an
       event handler for keyboard events in raw	mode

SYNOPSIS
       #include	<vgakeyboard.h>

       typedef void (*__keyboard_handler) (int scancode, int press);

       void keyboard_seteventhandler(__keyboard_handler	handler);
       void keyboard_setdefaulteventhandler(void);

DESCRIPTION
       These functions allow to	define	a  keyboard  event  handler  which  is
       called  by keyboard_update(3) and keyboard_waitforupdate(3) when	a key-
       board event occured.

       press is	KEY_EVENTRELEASE or KEY_EVENTPRESS if  key  scancode  was  re-
       leased  or  pressed.  Actually the first	value is 0 and the second is 1
       which are so intuitive s.t. you may use them in your program.

       Even you	specify	an own handler,	svgalib	will  check  for  <Alt>-F*  or
       <Ctrl>-C	 for  console  switches	 or generation of SIGINT if allowed by
       keyboard_translatekeys(3).

       Calling keyboard_setdefaulteventhandler() reinstates the	 default  han-
       dler  which  maintains the tables used by keyboard_getstate(3) and key-
       board_keypressed(3).   It  is  probably	a  good	 idea  to  call	  key-
       board_clearstate(3) after reenabling the	default	handler.

       Here  are  the supported	scancodes. The names of	the #defines originate
       from the	US keyboard layout, for	other countries, they'll refer to  the
       key in the same physical	location, but the keycap will have a different
       inscription. For	the list below,	add SCANCODE_ in front of the names to
       get the right name for your C source. That means, if it lists BACKSLASH
       below, you shall	use SCANCODE_BACKSLASH as symbol in your  program.  In
       addition	to the names below we also have	SCANCODE_0 - SCANCODE_9, SCAN-
       CODE_KEYPAD0 - SCANCODE_KEYPAD9,	SCANCODE_A  -  SCANCODE_Z,  and	 SCAN-
       CODE_F1 - SCANCODE_F12.

       The   other  key	 names	are  ESCAPE,  MINUS,  EQUAL,  BACKSPACE,  TAB,
       BRACKET_LEFT, BRACKET_RIGHT, ENTER, LEFTCONTROL,	SEMICOLON, APOSTROPHE,
       GRAVE,  LEFTSHIFT, BACKSLASH, COMMA, PERIOD, SLASH, RIGHTSHIFT, KEYPAD-
       MULTIPLY, LEFTALT, SPACE, CAPSLOCK, NUMLOCK, SCROLLLOCK,	 CURSORUPLEFT,
       CURSORUP,  CURSORUPRIGHT, KEYPADMINUS, CURSORLEFT, CURSORRIGHT, KEYPAD-
       PLUS, CURSORDOWNLEFT, CURSORDOWN, CURSORDOWNRIGHT, KEYPADPERIOD,	 LESS,
       KEYPADENTER,  RIGHTCONTROL,  CONTROL,  KEYPADDIVIDE, PRINTSCREEN, RIGH-
       TALT, BREAK, BREAK_ALTERNATIVE, HOME,  CURSORBLOCKUP,  PAGEUP,  CURSOR-
       BLOCKLEFT,  CURSORBLOCKRIGHT,  END,  CURSORBLOCKDOWN, PAGEDOWN, INSERT,
       and REMOVE.

SEE ALSO
       svgalib(7), vgagl(7), libvga.config(5), keytest(6), eventtest(6),  key-
       board_init(3),	keyboard_init_return_fd(3),   keyboard_close(3),  key-
       board_getstate(3), keyboard_keypressed(3), keyboard_clearstate(3), key-
       board_translatekeys(3),	keyboard_update(3), keyboard_waitforupdate(3),
       vga_waitevent(3)

AUTHOR
       This manual page	was edited by Michael Weller  <eowmob@exp-math.uni-es-
       sen.de>.	 The exact source of the referenced function as	well as	of the
       original	documentation is unknown.

       It is very likely that both are at least	to some	extent are due to Harm
       Hanemaayer <H.Hanemaayer@inter.nl.net>.

       Occasionally  this  might be wrong. I hereby asked to be	excused	by the
       original	author and will	happily	accept any additions or	corrections to
       this first version of the svgalib manual.

Svgalib	(>= 1.2.11)		 27 July 1997	   keyboard_seteventhandler(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=keyboard_seteventhandler&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help