protected KeyStroke getKeyStrokeRaw ( char first , int num1 , int num2 , char last , boolean bEsc ) { KeyType kt ; boolean bPuttyCtrl = false ; if ( last == ' ' && stdMap . containsKey ( num1 ) ) { kt = stdMap . get ( num1 ) ; } else if ( finMap . containsKey ( last ) ) { kt = finMap . get ( last ) ; // Putty sends ^[OA for ctrl arrow-up, ^[[A for plain arrow-up: // but only for A-D -- other ^[O... sequences are just plain keys if ( first == ' ' && last >= ' ' && last <= ' ' ) { bPuttyCtrl = true ; } // if we ever stumble into "keypad-mode", then it will end up inverted. } else { kt = null ; // unknown key. } int mods = num2 - 1 ; if ( bEsc ) { if ( mods >= 0 ) { mods |= ALT ; } else { mods = ALT ; } } if ( bPuttyCtrl ) { if ( mods >= 0 ) { mods |= CTRL ; } else { mods = CTRL ; } } return getKeyStroke ( kt , mods ) ; }
combines the raw parts of the sequence into a KeyStroke . This method does not check the first char but overrides may do so .