delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/16:20:37

From: igp AT vlc DOT servicom DOT es (Ignacio García Pérez)
Newsgroups: comp.os.msdos.djgpp
Subject: ALLEGRO keyboard question
Date: Thu, 17 Dec 1998 20:48:39 GMT
Organization: SERVICOM
Lines: 43
Message-ID: <36789c10.11913702@crispin>
NNTP-Posting-Host: be-36-vale-x1.red.retevision.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.452
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi:

Allegro keyboard handling routines are great for games and such, but
have the disadvantage that you lose the installed DOS keyboard
mapping, and this is what I want to keep.

Why ?... because I'm not programming a game, and still need the GUI
routines to work.

I have two alternatives:

1- Load a keyboard map table from a .DAT file. In my case, load the
spanish table, and everything works fine. But when the program goes to
a foreign country, then the user will have to configure the keyboard,
and what if there's no allegro keyboard map for that country ?... as
opposed, we can assume if DOS is installed in that computer, the
keyboard mapping will be properly configured, and if it's not, well,
that's truly the user's problem, not my program's...

2- Use "install_keyboard_hooks" as the documentation says. But this
works very badly. I've used the code:

int my_keypressed(void) { return _bios_keybrd(_KEYBRD_READY); }
int my_readkey(void) { return _bios_keybrd(_KEYBRD_READ); }

...

install_keyboard_hooks((my_keypressed,my_readkey);


But I get all the extended characters (above ASCII 127) wrong, and the
extended keyboard works strangely too (when Num Lock is ON, some
extended number keys produce the ASCII number, and some others the
arrow movement).


Is there a simple and effective way to make allegro use the BIOS as
keyboard information provider so I can take profit from the installed
DOS keyboard mapping ?

Thanks. Nacho.

	

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019