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

FreeBSD Manual Pages

  
 
  

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

NAME
     keyboard_keypressed - check if a key is pressed when in raw keyboard mode

SYNOPSIS
     #include <vgakeyboard.h>

     int keyboard_keypressed(int scancode);

DESCRIPTION
     When  in  raw keyboard mode this routine checks if the key with scancode is
     pressed and returns KEY_PRESSED  or  KEY_NOTPRESSED  accordingly.	Actually
     KEY_PRESSED is 1 and KEY_NOTPRESSED is 0, s.t. you can use constructs like:

     if(keyboard_keypressed(SCANCODE_ENTER)) {
	  /* do something */
     }

     Please  note that keyboard events will only be processed when you occasion-
     ally call keyboard_update(3) or keyboard_waitforupdate(3).

     keyboard_translatekeys(3) allows certain remap operations which  make  cer-
     tain  keys  (digits,  enter) which might have several physical keys show up
     under the same scancodes.

     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	inscrip-
     tion.  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, SCANCODE_KEYPAD0 -  SCAN-
     CODE_KEYPAD9, SCANCODE_A - SCANCODE_Z, and SCANCODE_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,  KEYPADMULTIPLY,	LEFTALT,
     SPACE,  CAPSLOCK,	NUMLOCK,  SCROLLLOCK,	CURSORUPLEFT,	CURSORUP,   CUR-
     SORUPRIGHT,  KEYPADMINUS,	CURSORLEFT, CURSORRIGHT, KEYPADPLUS, CURSORDOWN-
     LEFT, CURSORDOWN, CURSORDOWNRIGHT, KEYPADPERIOD, LESS, KEYPADENTER,  RIGHT-
     CONTROL,  CONTROL, KEYPADDIVIDE, PRINTSCREEN, RIGHTALT, BREAK, BREAK_ALTER-
     NATIVE, HOME,  CURSORBLOCKUP,  PAGEUP,  CURSORBLOCKLEFT,  CURSORBLOCKRIGHT,
     END, CURSORBLOCKDOWN, PAGEDOWN, INSERT, and REMOVE.

SEE ALSO
     svgalib(7),  vgagl(7),  libvga.config(5),	keytest(6),  eventtest(6),  key-
     board_seteventhandler(3),	 keyboard_init(3),   keyboard_init_return_fd(3),
     keyboard_close(3),     keyboard_setdefaulteventhandler(3),    keyboard_key-
     pressed(3), keyboard_clearstate(3), keyboard_translatekeys(3), keyboard_up-
     date(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 orig-
     inal  author  and	will happily accept any additions or corrections to this
     first version of the svgalib manual.

Svgalib (>= 1.2.11)		  29 July 1997		  keyboard_keypressed(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=keyboard_keypressed&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help