From a2547dba0ecbb666f83b1391081a010bf48ec9b0 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 11 Nov 2011 02:38:48 +0000 Subject: [PATCH] A few updates and corrections to the new Keyboard page in the Haiku Book. I hope I got this in time before the next scheduled build of the Haiku Book. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43231 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- docs/user/keyboard/keyboard.dox | 55 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/docs/user/keyboard/keyboard.dox b/docs/user/keyboard/keyboard.dox index 20c8fab29f..fb8d631869 100644 --- a/docs/user/keyboard/keyboard.dox +++ b/docs/user/keyboard/keyboard.dox @@ -19,7 +19,7 @@ rarely, four bytes. Each key on the keyboard is assigned a numeric code to identify it to the operating system. Most of the time you should not have to access these codes directly, instead use one of the constants defined in InterfaceDefs.h -such \c B_BACKSPACE or \c B_ENTER or read the character from the \c key_map +such \c B_BACKSPACE or \c B_ENTER or read the character from the \c key_map struct. The following diagram shows the key codes as they appear on a US 104-key @@ -37,8 +37,8 @@ different locations. \section modifiers Modifier Keys -Modifier keys are keys that have no effect on their own but when combined with -another key they modify the usual behavior of that key. +Modifier keys are keys which have no effect on their own but when combined with +another key modify the usual behavior of that key. The following modifier keys are defined in InterfaceDefs.h @@ -47,7 +47,7 @@ The following modifier keys are defined in InterfaceDefs.h \c B_SHIFT_KEY Transforms lowercase case characters into uppercase characters - or chooses an alternative punctuation character. The shift key + or chooses alternative punctuation characters. The shift key is also used in combination with \c B_COMMAND_KEY to produce keyboard shortcuts. @@ -132,7 +132,7 @@ released. They are defined by the following constants: To get the currently active modifiers use the modifiers() function defined in InterfaceDefs.h. This function returns a bitmap containing the currently active modifier keys. You can create a bit mask of the above constants to -determine if the keys you are interested in are active. +determine which modifiers are active. \section other_constants Other Constants @@ -203,7 +203,7 @@ For Japanese keyboard two more constants are defined: The characters produced by each of the key codes is determined by the keymap. The usual way to for the user to choose and modify their keymap is the Keymap preference application. A number of alternative keymaps such as dvorak -as well as keymaps for different locales are available. +and keymaps for different locales are available. \image html keymap.png @@ -220,10 +220,10 @@ To get the current system keymap create a pointer to a \c key_map struct and \c key_map struct will be filled out with the current system keymap and the \c char array will be filled out with the UTF-8 character encodings. -The \c key_map struct contains a number of fields. These fields are described +The \c key_map struct contains a number of fields. Each field is described in several sections below. -The first section contains a version number and the codes assigned to each of +The first section contains a version number and the code assigned to each of the modifier keys. @@ -286,7 +286,7 @@ set_keyboard_locks() function. The next section of the \c key_map struct contains maps of offsets into the array of UTF-8 character encodings filled out in the second -parameter by get_key_map(). Since the character maps are filled with UTF-8 +parameter of get_key_map(). Since the character maps are filled with UTF-8 characters they may be 1, 2, 3, or rarely 4 bytes long. The characters are contained in non-\c NUL terminated Pascal strings. The first byte of the string indicates how many bytes the character is made up of. For example the @@ -296,13 +296,16 @@ string for a horizontal ellipses (...) character looks like this: x03xE2x80xA6 \endcode -The first byte is 03 meaning that the character is 3 bytes long. The bytes -E2 80 A6 is the UTF-8 byte representation of the horizontal ellipses character. -Recall that there is no terminating \c NUL character for these strings. +The first byte is 03 meaning that the character is 3 bytes long. The +remaining bytes E2 80 A6 are the UTF-8 byte representation of the horizontal +ellipses character. Recall that there is no terminating \c NUL character for +these strings. Not every key is mapped to a character. If a key is unmapped the character array contains a 0-byte string. Unmapped keys do not produce \c B_KEY_DOWN -messages. Modifier keys should not be mapped into the character array. +messages. + +Modifier keys should not be mapped into the character array. The following character maps are defined:
@@ -356,16 +359,16 @@ The following character maps are defined: \section dead_keys Dead Keys Dead keys are keys that do not produce a character until they are combined -with another key. Because the key does not produce a character on their own -they are considered "dead" until they are brought to life by being combined -with another key. These dead keys are generally used to produce accented +with another key. Because these keys do not produce a character on their own +they are considered "dead" until they are "brought to life" by being combined +with another key. Dead keys are generally used to produce accented characters. Each of the fields below is a 32-byte array of dead key characters. The dead -keys are organized into pairs in the array so each dead key array can contain +keys are organized into pairs in the array. Each dead key array can contain up to 16 pairs of dead key characters. The first pair in the array should contain \c B_SPACE followed by and the accent character in the second offset. -This serves to identify what accent character is contained in the array +This serves to identify which accent character is contained in the array and serves to define a space followed by accent pair to represent the unadorned accent character. @@ -395,7 +398,7 @@ followed by the accent character.
-The final section contains a bitmap that indicate which character table is +The final section contains bitmaps that indicate which character table is used for each of the above dead keys. The bitmap can contain any of the following constants: - \c B_CONTROL_TABLE @@ -408,29 +411,29 @@ following constants: - \c B_NORMAL_TABLE - \c B_OPTION_TABLE -The bitmap often contains \c B_OPTION_TABLE because accent characters are -typically produced in combination with the \c B_OPTION_KEY. +The bitmaps often contain \c B_OPTION_TABLE because accent characters are +generally produced by combining a letter with \c B_OPTION_KEY. - + - + - + - + - +
\c acute_tablesAcute dead keys arrayAcute dead keys table bitmap
\c grave_tablesGrave dead keys arrayGrave dead keys table bitmap
\c circumflex_tablesCircumflex dead keys arrayCircumflex dead keys table bitmap
\c dieresis_tablesDeeresis dead keys arrayDieresis dead keys table bitmap
\c tilde_tablesTilde dead keys arrayTilde dead keys table bitmap