11.07.2015 Views

Upgrade Guide - Prolifics

Upgrade Guide - Prolifics

Upgrade Guide - Prolifics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Processing Keyboard InputKey TranslationThe first two steps in Panther's processing of keyboard input–identification andtranslation–are controlled by the binary key translation file, loaded at initialization.Panther finds the file's name in a setup file or in the environment (refer to theConfiguration <strong>Guide</strong> for details). The binary file is derived from an ASCII file that youcan modify with any text editor.Panther assumes that the first input character of a multi-character key sequence is acontrol character in the ASCII chart (0x00-0x1f, 0x7f, 0x80-0x9f, or 0xff) andattempts to translate the character to a single logical key. Characters outside this rangeare assumed to be displayable characters and are not translated.Note:This algorithm assumes that a timing interval (KBD_DELAY entry in the videofile) has not been specified. For more information, refer to KBD_DELAY onpage 7-24 in Configuration <strong>Guide</strong>.On receiving a control character, the keyboard input function sm_getkey searches thekey translation file for a sequence beginning with that character. If no match is foundon the first character, Panther accepts the key without translation. If a match is foundon the first character, an exact match, sm_getkey returns the indicated value. Thesearch continues through subsequent characters until one of the following conditionsis true:! An exact match on n characters is found and the nth+1 character in the file is 0,or n is 6. In this case, the value in the file is returned.! An exact match is found on n-1 characters but not on n. In this case,sm_getkey attempts to flush the sequence of characters returned by the key.The latter condition is of some importance: if the user presses a function key that is notdefined in the file, Panther must know where the key sequence ends. The followingalgorithm is then used:! The file is searched for all entries that match the first n-1 characters and are ofthe same type in the nth character, where the types are digit, control character,letter, and punctuation. The smallest of the total lengths of these entries isassumed to be the length of the sequence produced by the key.! If there is no entry matches by type at the nth character, the shortest sequencethat matches on n-1 characters is used. Hence, sm_getkey can distinguish, forexample, between the sequences ESC O x, ESC [ A, and ESC [ 1 0 ~.<strong>Upgrade</strong> <strong>Guide</strong> B-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!