Console Windows keyboard event handler in Cygwin

Corinna Vinschen vinschen@redhat.com
Sun Apr 4 11:09:00 GMT 2004


On Apr  4 10:04, Andy Chow wrote:
> Finally I try to resolve the problem by myself.

Good idea, that's what we are here for.

> Some one has said that Windows dosn't generate Ctrl-space key code (0x00), that's right, but it should be cygwin responsibility to translate Windows keyboard event to unix like key code. 
> Inside Cygwin DLL, the fhandler_console::read function is responsible to convert Windows console input to unix like key code, the WIN32 API ReadConsoleInput is used to read console input event. When ReadConsoleInput get a keyboard, it should check if the virtual key is VK_SPACE, if it is, it should check the control_key_state and if control key is pressed, it should translate the VK_SPACE to the key code 0x00.
> 
> For backspace key, Windows always translate it to 0x08, which is same as Ctrl-H, I modify the fhandler_console::read to translate it to 0x7F(DEL) so it will not conflict with Ctrl-H in emacs.

That would not be backward compatible.  There should at least be a setting
to switch the backspace mapping between BS and DEL.  Does anybody know how
that's done in the Linux console btw?

> I don't sure it will cause another problem, but I use this method to fix some annoying problem in emacs.

If you have patches, go ahead and send them to the cygwin-patches list.
You should subscribe to that list anyway if you're planning to submit
patches.  But you know that you need to send a copyright assignment form
to Red Hat first before we can accept patches, right?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-developers mailing list