blob: a5a9987ae25467f86c0e625f6d4cd47e88e8066d [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001// hardwarekeyboard.cpp - HardwareKeyboard object
2// Shell file used for most devices. A custom hardwarekeyboard.cpp is needed for devices with a hardware keyboard.
3
4#include <stdarg.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include <fcntl.h>
9#include <sys/reboot.h>
10#include <sys/stat.h>
11#include <sys/time.h>
12#include <sys/mman.h>
13#include <sys/types.h>
14#include <sys/ioctl.h>
15#include <time.h>
16#include <unistd.h>
17#include <stdlib.h>
18
19#include <string>
20
21extern "C" {
Dees_Troy2673cec2013-04-02 20:22:16 +000022#include "../twcommon.h"
Dees_Troy51a0e822012-09-05 15:24:24 -040023#include "../minuitwrp/minui.h"
Dees_Troy51a0e822012-09-05 15:24:24 -040024}
25
26#include "rapidxml.hpp"
27#include "objects.hpp"
28
Vojtech Bocekfafb0c52013-07-25 22:53:02 +020029HardwareKeyboard::HardwareKeyboard(void)
30{
31
Dees_Troy51a0e822012-09-05 15:24:24 -040032}
33
Vojtech Bocekfafb0c52013-07-25 22:53:02 +020034HardwareKeyboard::~HardwareKeyboard()
35{
36
Dees_Troy51a0e822012-09-05 15:24:24 -040037}
38
Vojtech Bocekfafb0c52013-07-25 22:53:02 +020039int HardwareKeyboard::KeyDown(int key_code)
40{
Dees_Troy51a0e822012-09-05 15:24:24 -040041#ifdef _EVENT_LOGGING
Dees_Troy2673cec2013-04-02 20:22:16 +000042 LOGERR("HardwareKeyboard::KeyDown %i\n", key_code);
Dees_Troy51a0e822012-09-05 15:24:24 -040043#endif
44 PageManager::NotifyKey(key_code);
45 return 0; // 0 = no key repeat anything else turns on key repeat
46}
47
Vojtech Bocekfafb0c52013-07-25 22:53:02 +020048int HardwareKeyboard::KeyUp(int key_code)
49{
Dees_Troy51a0e822012-09-05 15:24:24 -040050#ifdef _EVENT_LOGGING
Dees_Troy2673cec2013-04-02 20:22:16 +000051 LOGERR("HardwareKeyboard::KeyUp %i\n", key_code);
Dees_Troy51a0e822012-09-05 15:24:24 -040052#endif
53 return 0;
54}
55
Vojtech Bocekfafb0c52013-07-25 22:53:02 +020056int HardwareKeyboard::KeyRepeat(void)
57{
Dees_Troy51a0e822012-09-05 15:24:24 -040058#ifdef _EVENT_LOGGING
Dees_Troy2673cec2013-04-02 20:22:16 +000059 LOGERR("HardwareKeyboard::KeyRepeat\n");
Dees_Troy51a0e822012-09-05 15:24:24 -040060#endif
61 return 0;
62}