pike.git / lib / modules / Protocols.pmod / X.pmod / KeySyms.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/X.pmod/KeySyms.pmod:20:    * along with this program; if not, write to the Free Software    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    */      #pike __REAL_VERSION__      #include "keysyms.h"       int alt_gr, num_lock, shift, control, caps_lock;    int meta, alt, super, hyper; + //!       mapping attributes = ([]); -  + //!    -  + //!    mapping stringtokeysyms = ([   "XK_script_switch": 0xFF7E /* Alias for mode_switch */,   "XK_dead_acute": 0xFE51,   "XK_dead_circumflex": 0xFE52,   "XK_dead_tilde": 0xFE53,   "XK_dead_macron": 0xFE54,   "XK_dead_breve": 0xFE55,   "XK_dead_abovedot": 0xFE56,   "XK_dead_diaeresis": 0xFE57,   "XK_dead_abovering": 0xFE58,
pike.git/lib/modules/Protocols.pmod/X.pmod/KeySyms.pmod:1339:   "XK_Hangul_YeorinHieuh": 0xef5,   "XK_Hangul_AraeA": 0xef6,   "XK_Hangul_AraeAE": 0xef7,   "XK_Hangul_J_PanSios": 0xef8,   "XK_Hangul_J_KkogjiDalrinIeung": 0xef9,   "XK_Hangul_J_YeorinHieuh": 0xefa,   "XK_Korean_Won": 0xeff   ]);       + //!    void ReleaseKey( int sym )    {    switch(sym)    {    case XK_Scroll_Lock: return 0; break;    case XK_Mode_switch: alt_gr = 0; return;    case XK_Num_Lock: num_lock = 0; return;    case XK_Shift_L:    case XK_Shift_Lock:    case XK_Shift_R: shift=0; return;    case XK_Control_L: case XK_Control_R: control=0; return;    case XK_Caps_Lock: caps_lock=0; return;       case XK_Meta_L: case XK_Meta_R: meta=0; return;    case XK_Alt_L: case XK_Alt_R: alt=0; return;    case XK_Super_L:case XK_Super_R: super=0; return;    case XK_Hyper_L: case XK_Hyper_R: hyper=0; return;    }    }    -  + //!    string _LookupKeysym( int keysym )    {    switch(keysym)    {    case XK_BackSpace: return "";    case XK_Tab: return "\t";    case XK_Linefeed: return "\n";    case XK_Return: return "\n";    case XK_Escape: return "";    case XK_Delete: return "";
pike.git/lib/modules/Protocols.pmod/X.pmod/KeySyms.pmod:1410:    default:    if(keysym < 256)    return sprintf("%c", keysym);    return 0;    /*Latin2 .. latin3 .. latin4 .. katakana .. arabic .. cyrillic ..    greek .. technical .. special .. publishing .. APL .. hebrew ..    thai .. korean .. hangul .. */    }    }    + //!    int _LookupCharacter( string str )    {    if(stringtokeysyms && stringtokeysyms[str])    return stringtokeysyms[str];       // not found?    else return -1;       }       -  + //!    int LookupCharacter( string str )    {    mapping xkm=([    " " : "XK_space",    "!" : "XK_exclam",    "\"": "XK_quotedbl",    "#" : "XK_numbersign",    "$" : "XK_dollar",    "%" : "XK_percent",    "&" : "XK_ampersand",
pike.git/lib/modules/Protocols.pmod/X.pmod/KeySyms.pmod:1467:    return _LookupCharacter(xkm[str]);    else return _LookupCharacter("XK_" + str);       }       mapping compose_patterns;    string compose_state = "";       mapping keysymtokeycode=([]);    + //!    void makeKeysymtoKeycode(object display)    {    keysymtokeycode=([]);    int i=0;    for(int i=0; i<sizeof(display->key_mapping); i++)    {    if(intp(display->key_mapping[i])) { continue; }    int mod=0;    foreach(display->key_mapping[i], int code)    {       if(keysymtokeycode[code]) continue;    else keysymtokeycode[code]=({i, mod});    mod++;    }    }    }    -  + //!    int LookupKeycode( int keysym, object display )    {    int keycode;       if(sizeof(keysymtokeycode)==0) makeKeysymtoKeycode(display);    if(keysymtokeycode[keysym]) {    keycode=keysymtokeycode[keysym][0];    }    else keycode=-1;       return keycode;    }    -  + //!    string LookupKeysym( int keysym, object display )    {    if(!compose_patterns) compose_patterns = display->compose_patterns;    switch(keysym)    {    case XK_A..XK_Z:    case XK_a..XK_z:    keysym = keysym&0xdf; // Upper..    if(!shift && !caps_lock) //    keysym=keysym+0x20; // .. and lower ..