A layout contains multiple lines separated by newlines. The first line is a (max. 3-char) label. The following lines contain one char for each keyboard key. The meaning for the chars is as follows:
More than one same character on a row or a column will be grouped together as one single button (i.e. "KK" gives you a 2-cell-wide Backspace button). If this makes a widget higher than wide and the widget's label doesn't fit left-to-right, text direction will be bottom-to-top. Buttons cannot go around corners! I.e. don't construct something as this:
This will not give you a right-angled return button, but rather something undefined.
|
Public Types |
| enum | SpecialKey {
KEY_SHIFT = 'S',
KEY_CAPSLOCK = 'L',
KEY_BACKSPACE = 'K',
KEY_DEL = 'E',
KEY_RETURN = 'R',
KEY_NEXTLAYOUT = 'N',
KEY_CHOOSELAYOUT_0 = 'A',
KEY_CHOOSELAYOUT_1 = 'B',
KEY_CHOOSELAYOUT_2 = 'C',
KEY_CHOOSELAYOUT_3 = 'D'
} |
Public Member Functions |
| | BKeyboard (BWidget *parent, const BRect &frame) |
| void | setLayout (const std::string &layout) |
| void | setLayouts (const std::vector< std::string > &layouts) |
| void | chooseLayoutNum (unsigned int num) |
| void | chooseNextLayout () |
| void | onButtonClick (BButton *button) |
| void | setDelegate (Delegate *deleg) |
| Delegate * | delegate () |
Static Public Member Functions |
| std::vector< std::string > | defaultLayouts () |
| std::deque< std::string > | loadLayouts (BVirtualFile *file) |
Static Public Attributes |
| std::string | qwertzLayout |
| std::string | numLayout |
| std::string | specialLayout |
Protected Member Functions |
| BSize | sizeOfLayoutCell (const std::string &layout) |
| void | setupSpecialButton (BButton *button) |
| void | uppercaseVisibleButtons () |
| void | lowercaseVisibleButtons () |
Protected Attributes |
std::vector< std::vector<
BButton * > > | _buttons |
| std::vector< std::string > | _layouts |
| Delegate * | _deleg |
| unsigned int | _curLayoutnum |