- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/woopsikeyboard.h

    00001 #ifndef _WOOPSI_KEYBOARD_H_
    00002 #define _WOOPSI_KEYBOARD_H_
    00003
    00004 #include <nds.h>
    00005 #include "amigawindow.h"
    00006 #include "woopsiarray.h"
    00007
    00008 namespace WoopsiUI {
    00009
    00010         class WoopsiKey;
    00011         class WoopsiTimer;
    00012         class KeyboardEventHandler;
    00013
    00018         class WoopsiKeyboard : public AmigaWindow {
    00019         public:
    00020
    00032                 WoopsiKeyboard(s16 x, s16 y, u16 width, u16 height, const char* title, u32 flags, u32 windowFlags, FontBase* font = NULL);
    00033
    00038                 virtual void handleReleaseEvent(const GadgetEventArgs& e);
    00039
    00044                 virtual void handleReleaseOutsideEvent(const GadgetEventArgs& e);
    00045
    00050                 virtual void handleClickEvent(const GadgetEventArgs& e);
    00051
    00056                 virtual void handleActionEvent(const GadgetEventArgs& e);
    00057
    00062                 virtual void processKeyRelease(WoopsiKey* key);
    00063
    00068                 inline const bool isShiftDown() const { return _isShiftDown; };
    00069
    00074                 inline const bool isControlDown() const { return _isControlDown; };
    00075
    00080                 inline const bool isCapsLockDown() const { return _isCapsLockDown; };
    00081
    00087                 inline void addKeyboardEventHandler(KeyboardEventHandler* eventHandler) { _keyboardEventHandlers.push_back(eventHandler); };
    00088
    00093                 void removeKeyboardEventHandler(KeyboardEventHandler* eventHandler);
    00094
    00095         protected:
    00096                 WoopsiKey* _shiftKey;
    00097                 WoopsiKey* _controlKey;
    00098                 WoopsiKey* _capsLockKey;
    00099                 bool _isShiftDown;
    00100                 bool _isControlDown;
    00101                 bool _isCapsLockDown;
    00102                 WoopsiTimer* _timer;
    00103                 u32 _initialRepeatTime;
    00104                 u32 _secondaryRepeatTime;
    00105                 WoopsiArray<KeyboardEventHandler*> _keyboardEventHandlers;
    00110                 void showCorrectKeys();
    00111
    00115                 void showNormalKeys();
    00116
    00120                 void showShiftKeys();
    00121
    00125                 void showControlKeys();
    00126
    00130                 void showShiftControlKeys();
    00131
    00135                 void showCapsLockKeys();
    00136
    00140                 void showControlCapsLockKeys();
    00141
    00145                 virtual inline ~WoopsiKeyboard() { };
    00146
    00150                 inline WoopsiKeyboard(const WoopsiKeyboard& keyboard) : AmigaWindow(keyboard) { };
    00151
    00156                 void raiseKeyboardPressEvent(WoopsiKey* key);
    00157
    00162                 void raiseKeyboardRepeatEvent(WoopsiKey* key);
    00163
    00168                 void raiseKeyboardReleaseEvent(WoopsiKey* key);
    00169         };
    00170 }
    00171
    00172 #endif

All Classes Functions Variables Enumerations Enumerator