OSDN Git Service

b3f99f81b72368d5d8244325d92e4f2786f3f803
[csp-qt/common_source_project-fm7.git] / source / src / vm / pc9801 / keyboard.h
1 /*
2         NEC PC-9801 Emulator 'ePC-9801'
3         NEC PC-9801E/F/M Emulator 'ePC-9801E'
4         NEC PC-9801U Emulator 'ePC-9801U'
5         NEC PC-9801VF Emulator 'ePC-9801VF'
6         NEC PC-9801VM Emulator 'ePC-9801VM'
7         NEC PC-9801VX Emulator 'ePC-9801VX'
8         NEC PC-9801RA Emulator 'ePC-9801RA'
9         NEC PC-98XA Emulator 'ePC-98XA'
10         NEC PC-98XL Emulator 'ePC-98XL'
11         NEC PC-98RL Emulator 'ePC-98RL'
12         NEC PC-98DO Emulator 'ePC-98DO'
13
14         Author : Takeda.Toshiya
15         Date   : 2010.09.16-
16
17         [ keyboard ]
18 */
19
20 #ifndef _KEYBOARD_H_
21 #define _KEYBOARD_H_
22
23 #include "../vm.h"
24 #include "../../emu.h"
25 #include "../device.h"
26
27 #define SIG_KEYBOARD_RECV       0
28
29 class KEYBOARD : public DEVICE
30 {
31 private:
32         DEVICE *d_sio;
33         
34         bool kana, caps;
35         uint8_t flag[256];
36         
37 public:
38         KEYBOARD(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
39         {
40                 set_device_name(_T("Keyboard"));
41         }
42         ~KEYBOARD() {}
43         
44         // common functions
45         void initialize();
46         void reset();
47         bool process_state(FILEIO* state_fio, bool loading);
48         
49         // unique functions
50         void set_context_sio(DEVICE* device)
51         {
52                 d_sio = device;
53         }
54         void key_down(int code, bool repeat);
55         void key_up(int code);
56         bool get_caps_locked()
57         {
58                 return caps;
59         }
60         bool get_kana_locked()
61         {
62                 return kana;
63         }
64 };
65
66 #endif