Keyboards

The Keyboard class has been split into two abstract classes, Keyboard and InputPanel. A keyboard is what comes up when you tap on the keyboard gadget in the control bar. An input panel is a mode of a keyboard. For example, the U.S. keyboard has three panels, the alphabet panel, the numbers panel, and the symbols panel. The Keyboard class contains information that is global to all the panels associated with that keyboard. The InputPanel class handles highlighting and drawing of keys as the user inputs data.

Because the tilde character (~) is common in URLs, it has been moved to the numeric keyboard, replacing the caret character (^). The caret is still available in the accents panel.

Renamed the Keyboard_Clear operation to ClearState().

Rosemary introduces a new mixin class, SystemBoard, which factors out the code that deals with putting up the keyboard window, switching complexity levels, and playing the sound when a key is pressed. Keyboard classes, as well as the handwriting recognition classes inherit from this mixin.

Added operations Keyboard_InputCharacter and Keyboard_InputCharacters. KeyInput_DispatchInput now calls InputCharacters() instead of DispatchKeys() when iCurrentKeyboard is not nilObject. This allows Japanese input boards to treat input from hardware keyboards in the same way as input from software keyboards are treated.

The kLettersMode keyboard mode has been replaced with two modes, kDefaultAlphabetMode and kRomanAlphabetMode. The new mode is necessary to allow text fields to specify whether they accept only Roman characters, or whether they can accept characters from the default keyboard of another language. For U.S. versions of Magic Cap, these two modes bring up the same keyboard. For Japanese versions of Magic Cap, kDefaultAlphabetMode can bring up one of many input boards. The additional mode has caused the values for kNumbersMode and kExtendedMode to shift. Because the two new modes are associated, it was decided to keep their values contiguous instead of maintaining the old values for kNumbersMode and kExtendedMode.

Keyboard classes have been changed to work with the new extra data format. The box, type and data information that used to be kept in extra data are now kept in separate lists referenced by the fields boxList, typeList, and dataList.

Added the attribute Keyboard_CapsMode. You can use this attribute to query the current caps lock setting of a keyboard, and to set the setting. This is cleaner than setting the lastPeriodFlag then calling KeyTyped(spaceCharacter) which is what you needed to do before.

Added the attribute AcceptsTyping_ModeAlteration, which always returns kDefaultAlphabetMode.

Classes affected by these changes

AcceptsTyping
AlphabetPanel new
InputPanel new
Keyboard
SystemBoard
SystemKeyboard obsolete