Cabal Common Library Doc Keyboard
This is the main class for the keyboard with its members.
The keyboard is fairly simple to use and requires only a worldScripts call with a few parameters. Optionally, the calling script can provide a callback which is executed when the user has finished entering characters. Everything else performed within the script.
The keyboard itself ships 4 different modes
A keyboard can only be called when the player is docked! Please also note, that missionchoices are a bit tricky and require a workaround! This doesn’t usually affect the calling script, but if it happens (and it will happen if you are calling another mission screen with choices in the callback function) you’ll have to use the same workaround as the keyboard.
|this.start = function( who, min, mode, scpic, scovl, scmod )|
Starts the keyboard handling, creates the keyboard object and calls keyboardShow(). If ‘who’ is specified the script will callback after completing or aborting. See keyboardChoice() for the callback.
- String. The name of a worldScript which implements the keyboard callback.
- Number. Optional - minimum length for completion, default(4).
- Number. Optional - 1(only alphabetical), 2(only numeric), 3(hexadecimal), default 4(alphanumeric).
- String. Optional. Name for screenbackground build upon scpic + suffix. The mode defines which one will be used.
- String. Optional. Filename for screenoverlay (with fileextension). Default null.
- String. Optional. Role for the used model. Default ‘cabal_common_key’.
Suffixes are :
- 1 - ‘_keyboard_alpha.png’
- 2 - ‘_keyboard_nums.png’
- 3 - ‘_keyboard_hex.png’
- 4 - ‘_keyboard.png’
|this.keyboardEval = function( choice )|
Workaround to change the context of this!!! It simply passes the choice to keyboardChoice().
- String. Passed parameter from Oolite.
|this.keyboardChoice = function( choice )|
Evaluates the user choice. When keyboard.toCall is specified and user confirms or aborts the keyboard input.
- ”” - String. if user aborts.
- keyboard.input - String. If user confirmed input.
- String. Passed parameter from Oolite, passed through keyboardEval().