pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/53627 DOSBox keyboard does not work on console (wscons)



The following reply was made to PR pkg/53627; it has been noted by GNATS.

From: Michael van Elst <mlelstv%serpens.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/53627 DOSBox keyboard does not work on console (wscons)
Date: Sat, 29 Sep 2018 01:46:24 +0200

 wscons gives you scancodes as is, i.e. dependent on the actual hardware.
 E.g. on a PC with AT keyboard you'll get scancode 30 for the 'a' key.
 
 Xorg (not Linux) shifts this by MIN_KEYCODE (== 8), but when talking to
 wscons it might do some additional remapping of scancodes to appear like
 an AT keyboard (plus that shift). Apparently Xorg needs codes 0..7 for
 something else, that's why the shift is done.
 
 SDL just passes through the scancodes it gets passed from wscons or from X.
 
 DOSbox thinks Linux is always X and X is always Xorg and subtracts 8 to get
 back to AT scancodes.
 
 SDL may also pass through some virtualized keyboard events that are supposed
 to be identical for all environments. DOSbox can use this by disabling
 the "usescancodes" entry in the configuration file. Unfortunately that
 feature isn't implemented fully, the wscons code in SDL supports this
 only for WSKBD_TYPE_ZAURUS.
 
 So it's all a mess.
 
 
 DOSBox could use SDL_VideoDriverName() to find out wether it's using the
 wscons driver and not adjust the scancode then. Still gross, but SDL
 apparently doesn't reveal the keyboard mapping to a client.
 
 
 
 Greetings,
 -- 
                                 Michael van Elst
 Internet: mlelstv%serpens.de@localhost
                                 "A potential Snark may lurk in every tree."
 


Home | Main Index | Thread Index | Old Index