1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: NeXT Keymapping</TITLE>
<META NAME="description" CONTENT="Crystal Space: NeXT Keymapping">
<META NAME="keywords" CONTENT="Crystal Space: NeXT Keymapping">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">
</HEAD>
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<A NAME="SEC619"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_254.html#SEC618"> < </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_256.html#SEC620"> > </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_247.html#SEC611"> << </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_248.html#SEC612"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_257.html#SEC623"> >> </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H4> 8.1.1.7 Key Mapping </H4>
<!--docid::SEC619::-->
<P>
For keyboard events, Crystal Space's event system expects the platform-specific
driver to provide both the raw key code and the cooked character code. For
instance, for <KBD><KBD>Alt</KBD>-p</KBD>, the raw key code is <KBD>p</KBD> and the cooked
character code would be whatever that keytroke is mapped to in the current
key-mapping (for instance, Greek
`pi').
</P><P>
Unfortunately, the AppKit event mechanism in NextStep cooks the raw key code
completely out of existence and only makes available the final character code
along with the hardware scan code of the depressed key. The `<SAMP>NSEvent</SAMP>'
class in Cocoa and OpenStep, on the other hand, make both the raw key code and
the cooked character code available.
</P><P>
In order to provide Crystal Space with the raw key code on NextStep, it was
necessary to reverse-engineer the format of the raw key-mapping resource
(`<TT>.keymapping</TT>' files). Once accomplished, a special class,
`<SAMP>NeXTKeymap</SAMP>', was created to interpret the key-mapping. This class parses
the private key-mapping data structure used by the WindowServer and the AppKit
and provides a mechanism for translating hardware scan codes to the raw key
codes which Crystal Space expects.
</P><P>
`<SAMP>NeXTKeymap</SAMP>' is implemented in
`<TT>CS/libs/cssys/next/nextstep/NeXTKeymap.m</TT>'. It is based upon extracts
from the program `<TT>dumpkeymap</TT>' which is a diagnostic utility for
interpreting `<TT>.keymapping</TT>' files. The source code and full documentation
for `<SAMP>dumpkeymap</SAMP>' are available at
`<TT>CS/libs/cssys/next/support/dumpkeymap</TT>'. `<SAMP>dumpkeymap</SAMP>' was written by
Eric Sunshine, <A HREF="mailto:sunshine@sunshineco.com">sunshine@sunshineco.com</A>.
</P><P>
<A NAME="NeXT Notes"></A>
<HR SIZE=1>
<BR>
<FONT SIZE="-1">
This document was generated
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>
|