xref: /qemu/include/hw/input/ps2.h (revision 8b0caab07bf0056f44b52eb335faa45f07b7e1a6)
1fd65f595SWanpeng Li /*
2fd65f595SWanpeng Li  * QEMU PS/2 keyboard/mouse emulation
3fd65f595SWanpeng Li  *
4fd65f595SWanpeng Li  * Copyright (C) 2003 Fabrice Bellard
5fd65f595SWanpeng Li  *
6fd65f595SWanpeng Li  * Permission is hereby granted, free of charge, to any person obtaining a copy
7fd65f595SWanpeng Li  * of this software and associated documentation files (the "Software"), to deal
8fd65f595SWanpeng Li  * in the Software without restriction, including without limitation the rights
9fd65f595SWanpeng Li  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10fd65f595SWanpeng Li  * copies of the Software, and to permit persons to whom the Software is
11fd65f595SWanpeng Li  * furnished to do so, subject to the following conditions:
12fd65f595SWanpeng Li  *
13fd65f595SWanpeng Li  * The above copyright notice and this permission notice shall be included in
14fd65f595SWanpeng Li  * all copies or substantial portions of the Software.
15fd65f595SWanpeng Li  *
16fd65f595SWanpeng Li  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17fd65f595SWanpeng Li  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18fd65f595SWanpeng Li  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19fd65f595SWanpeng Li  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20fd65f595SWanpeng Li  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21fd65f595SWanpeng Li  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22fd65f595SWanpeng Li  * THE SOFTWARE.
23fd65f595SWanpeng Li  */
24fd65f595SWanpeng Li 
25fd65f595SWanpeng Li #ifndef HW_PS2_H
26fd65f595SWanpeng Li #define HW_PS2_H
27fd65f595SWanpeng Li 
28*8b0caab0SFabian Lesniak #define PS2_MOUSE_BUTTON_LEFT   0x01
29*8b0caab0SFabian Lesniak #define PS2_MOUSE_BUTTON_MIDDLE 0x02
30*8b0caab0SFabian Lesniak #define PS2_MOUSE_BUTTON_RIGHT  0x04
31*8b0caab0SFabian Lesniak #define PS2_MOUSE_BUTTON_SIDE   0x08
32*8b0caab0SFabian Lesniak #define PS2_MOUSE_BUTTON_EXTRA  0x10
33*8b0caab0SFabian Lesniak 
3487ecb68bSpbrook /* ps2.c */
3587ecb68bSpbrook void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg);
3687ecb68bSpbrook void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg);
3787ecb68bSpbrook void ps2_write_mouse(void *, int val);
3887ecb68bSpbrook void ps2_write_keyboard(void *, int val);
3987ecb68bSpbrook uint32_t ps2_read_data(void *);
4087ecb68bSpbrook void ps2_queue(void *, int b);
4187ecb68bSpbrook void ps2_keyboard_set_translation(void *opaque, int mode);
4287ecb68bSpbrook void ps2_mouse_fake_event(void *opaque);
43fd65f595SWanpeng Li 
44175de524SMarkus Armbruster #endif /* HW_PS2_H */
45