fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/arch/macplus/adb_keyboard.h *
7 * Created: 2010-11-04 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2010-2011 Hampa Hug <hampa@hampa.ch> *
9 *****************************************************************************/
10
11/*****************************************************************************
12 * This program is free software. You can redistribute it and / or modify it *
13 * under the terms of the GNU General Public License version 2 as published *
14 * by the Free Software Foundation. *
15 * *
16 * This program is distributed in the hope that it will be useful, but *
17 * WITHOUT ANY WARRANTY, without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19 * Public License for more details. *
20 *****************************************************************************/
21
22
23#ifndef PCE_MACPLUS_ADB_KEYBOARD_H
24#define PCE_MACPLUS_ADB_KEYBOARD_H 1
25
26
27#include "adb.h"
28
29#include <drivers/video/keys.h>
30
31#define ADB_KBD_BUF 256
32
33
34typedef struct {
35 pce_key_t key;
36 unsigned char code;
37 unsigned char flags;
38} adb_kbd_map_t;
39
40
41typedef struct {
42 adb_dev_t dev;
43
44 char talking;
45
46 unsigned buf_i;
47 unsigned buf_j;
48 unsigned char buf[ADB_KBD_BUF];
49
50 char keypad_motion_mode;
51
52 adb_kbd_map_t *keymap;
53} adb_kbd_t;
54
55
56void adb_kbd_set_key (adb_kbd_t *kbd, unsigned event, pce_key_t key);
57
58void adb_kbd_set_keypad_mode (adb_kbd_t *kbd, int motion);
59
60int adb_kbd_get_keypad_mode (const adb_kbd_t *kbd);
61
62void adb_kbd_init (adb_kbd_t *ak);
63
64adb_kbd_t *adb_kbd_new (void);
65
66
67#endif