Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

BKeyboard Class Reference

#include <BKeyboard.h>

Inheritance diagram for BKeyboard:

Inheritance graph
[legend]
Collaboration diagram for BKeyboard:

Collaboration graph
[legend]
List of all members.

Detailed Description

Keyboard class.

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:

  1. S: Shift ["Shift", "Shft", "^"]
  2. L: Caps Lock ["Caps Lock", "Lock", "L"]
  3. K: Backspace ("Kill") ["Backspace", "Bksp", "<-"]
  4. E: Del ("Erase") ["Delete", "Del", "X"]
  5. R: Return ["Return", "Ret", "R"]
  6. N: Switch to next keyboard layout [that layout's label]
  7. A-D: Switch to keyboard layout 0-3, accordingly [layout's label]

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:

                    abcR1
                    deRR2
  

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)
Delegatedelegate ()

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


Member Enumeration Documentation

enum BKeyboard::SpecialKey
 

Enumeration values:
KEY_SHIFT 
KEY_CAPSLOCK 
KEY_BACKSPACE 
KEY_DEL 
KEY_RETURN 
KEY_NEXTLAYOUT 
KEY_CHOOSELAYOUT_0 
KEY_CHOOSELAYOUT_1 
KEY_CHOOSELAYOUT_2 
KEY_CHOOSELAYOUT_3 


Constructor & Destructor Documentation

BKeyboard::BKeyboard BWidget   parent,
const BRect   frame
 


Member Function Documentation

void BKeyboard::chooseLayoutNum unsigned int    num
 

void BKeyboard::chooseNextLayout  
 

std::vector<std::string> BKeyboard::defaultLayouts   [static]
 

Delegate* BKeyboard::delegate   [inline]
 

std::deque<std::string> BKeyboard::loadLayouts BVirtualFile   file [static]
 

void BKeyboard::lowercaseVisibleButtons   [protected]
 

void BKeyboard::onButtonClick BButton   button [virtual]
 

Reimplemented from BButton::Delegate.

void BKeyboard::setDelegate Delegate   deleg
 

void BKeyboard::setLayout const std::string &    layout
 

void BKeyboard::setLayouts const std::vector< std::string > &    layouts
 

void BKeyboard::setupSpecialButton BButton   button [protected]
 

BSize BKeyboard::sizeOfLayoutCell const std::string &    layout [protected]
 

void BKeyboard::uppercaseVisibleButtons   [protected]
 


Member Data Documentation

std::vector<std::vector<BButton*> > BKeyboard::_buttons [protected]
 

unsigned int BKeyboard::_curLayoutnum [protected]
 

Delegate* BKeyboard::_deleg [protected]
 

std::vector<std::string> BKeyboard::_layouts [protected]
 

std::string BKeyboard::numLayout [static]
 

std::string BKeyboard::qwertzLayout [static]
 

std::string BKeyboard::specialLayout [static]
 


The documentation for this class was generated from the following file:
Generated on Sat Dec 29 10:00:30 2007 for DSGUI by doxygen1.3-rc3