Re: raw keyboard mode

Search this archive.

From: Russell Marks (russell.marks@dtn.ntl.com)
Date: Fri 10 Mar 2000 - 13:01:13 IST


> > My question is what is the raw keyboard mode? Is it the default?
> 
> No, it is NOT the default. Raw keyboard mode allows you to scan for
> "special" keys, like the four directional arrows or "Print Screen". You
> must deliberately enter raw keyboard mode, and then you must exit it
> before your program ends.

All true, however, there are two extra points I think I should add:

- You can actually check for many "special" keys like the cursors
  without using raw mode - zgv's src/readnbkey.c shows one way to do
  this. [1] The thing raw mode lets you do which you *can't* do any
  other way (in the general case), is to handle more than one key
  being pressed at once. This is often essential for games and
  emulators. Personally, though, I'd avoid raw mode unless you really
  need it.

- If you do use raw mode, be warned that svgalib will *not* let you
  see ctrl-c by default; it catches that and exits. If you need to be
  able to see ctrl-c, or if it's important that your program can't be
  killed off by pressing it, then you need to do
  `keyboard_translatekeys(DONT_CATCH_CTRLC);' after keyboard_init().

-Rus.

[1] Though it works in a strange (but in context, necessary) way - for
less insane svgalib programs :-), you'd probably want to use
vga_getkey() where that uses getnbkey().


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST