Keyboard(3)                                                        Keyboard(3)



NNAAMMEE
       Keyboard -

SSYYNNOOPPSSIISS
       Inherited by PPllaayyeerr.


   PPuubblliicc MMeetthhooddss
       __ccrreeaattee__kkeeyybbooaarrdd ()
       void aadddd__kkeeyy__ccooddee (int n, string val)
       void rreemmoovvee__kkeeyy__ccooddee (int n)
       mapping qquueerryy__kkeeyy__ccooddeess ()
       mapping sseett__kkeeyy__ccooddeess (mapping m)
       void cclleeaarr__kkeeyy__ccooddeess ()
       int ttrraannssllaattee__ccooddee (string val)

   PPuubblliicc AAttttrriibbuutteess
       mapping kkeeyy__ccooddeess

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       This file is inherited by players, or any other object that would be
       interactive and need to use the keyboard in a single- character input
       mode. It is used to recognize escape sequences.

       This component should be included in any object that needs to have its
       own keyboard settings. Players are the primary example of this. The MUD
       has a pretty decent set of 'default' escape codes built in (see
       keys.h), but players using unusual telnet clients may need to override
       some of them -- this is particularly common for fixing the
       backspace/delete fiasco. This file holds their override settings. These
       settings are manipulated by the 'keysetup' verb.

       Definition at line 18 of file keyboard.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   __ccrreeaattee__kkeeyybbooaarrdd (())
       Guarantee that key_codes is always a mapping.

       Definition at line 26 of file keyboard.c.

       References key_codes.

   vvooiidd aadddd__kkeeyy__ccooddee ((iinntt nn,, ssttrriinngg vvaall))
       Adds an escape sequence to the player's keyboard mapping.

       Definition at line 32 of file keyboard.c.

       References key_codes.

   vvooiidd cclleeaarr__kkeeyy__ccooddeess (())
       Restores this player's key codes setting to their defaults (no custom
       keys). Equivalent to set_key_codes( ([ ]) );

       Definition at line 77 of file keyboard.c.

       References key_codes.

   mmaappppiinngg qquueerryy__kkeeyy__ccooddeess (())
       RReettuurrnnss::
           The entire mapping of key codes. Be warned: it is indexed not by
           the integer values of the key codes, but by the values of the keys
           themselves. It is assumed that if you are calling this function,
           you know what you want.

       Definition at line 55 of file keyboard.c.

       References key_codes.

   vvooiidd rreemmoovvee__kkeeyy__ccooddee ((iinntt nn))
       Removes an escape sequence from the player's keyboard mapping.

       PPaarraammeetteerrss::

       _n      The key code to delete. Use the constants in keys.h.

       Definition at line 41 of file keyboard.c.

       References key_codes.

   mmaappppiinngg sseett__kkeeyy__ccooddeess ((mmaappppiinngg mm))
       Allows you to set the key codes directly. Not highly recommended, but
       it does allow for some kinds of debugging.

       PPaarraammeetteerrss::

       _m      A mapping of key codes. The code itself is the key, and the
              integer enumerated value is the value (see keys.h). If you pass
              in a non-mapping, it will be ignored.

       Definition at line 68 of file keyboard.c.

       References key_codes.

   iinntt ttrraannssllaattee__ccooddee ((ssttrriinngg vvaall))
       Used by any character-mode input handler that needs to recognize
       special keys (things like up-arrow, insert, ctrl+letter, etc.) Every
       time you receive a key outside of the normal range of type-able
       characters, you should start collecting characters which follow. The
       escape codes for special keys are anywhere from one to five or six
       bytes long. Call this function each time you get a new character, until
       it returns a value other than KEY_NONE; at this point, the key pressed
       has been recognized.

       As a safety valve, if the key is not recognized at all, then after 10
       characters this function will return KEY_UNKNOWN. If you get a
       KEY_UNKNOWN error you should flush out your key collector and perhaps
       give an error (so the user knows what happened).

       This function makes use of both the player's custom set of keys (set in
       keysetup) and a default mapping kept in keys.h.

       Definition at line 99 of file keyboard.c.

       References key_codes.

MMEEMMBBEERR DDAATTAA DDOOCCUUMMEENNTTAATTIIOONN
   mmaappppiinngg kkeeyy__ccooddeess
       A mapping from key escape codes to key values.

       Definition at line 23 of file keyboard.c.

       Referenced by _create_keyboard(), add_key_code(), clear_key_codes(),
       query_key_codes(), remove_key_code(), set_key_codes(), and
       translate_code().


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          8 Jan 2004                       Keyboard(3)
