The Pedigree Project
0.1
src
modules
subsys
native
include
pedigree
native
input
Input.h
1
/*
2
* Copyright (c) 2008-2014, Pedigree Developers
3
*
4
* Please see the CONTRIB file in the root of the source tree for a full
5
* list of contributors.
6
*
7
* Permission to use, copy, modify, and distribute this software for any
8
* purpose with or without fee is hereby granted, provided that the above
9
* copyright notice and this permission notice appear in all copies.
10
*
11
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*/
19
20
#ifndef _INPUT_H
21
#define _INPUT_H
22
23
#include "pedigree/native/compiler.h"
24
#include "pedigree/native/types.h"
25
26
namespace
Input {
28
const
int
Key = 1;
29
const
int
Mouse = 2;
30
const
int
Joystick = 4;
31
const
int
RawKey = 8;
32
const
int
AbsoluteMouse = 32;
33
const
int
Unknown = 255;
34
35
typedef
int
CallbackType;
36
40
struct
EXPORTED_PUBLIC
InputNotification
{
41
CallbackType type;
42
// Keep the userspace view aligned with the kernel event payload.
43
// Event-stream reads clear this reserved metadata slot.
44
void
* meta;
45
46
union
{
47
struct
{
48
uint64_t key;
49
} key;
50
struct
{
51
ssize_t relx;
52
ssize_t rely;
53
ssize_t relz;
54
55
bool
buttons[64];
56
} pointy;
57
struct
{
58
uint32_t x;
59
uint32_t y;
60
ssize_t wheel;
61
62
bool
buttons[64];
63
} absolute;
64
struct
{
67
uint8_t
scancode
;
68
70
bool
keyUp
;
71
} rawkey;
72
} data;
73
};
74
78
EXPORTED_PUBLIC
int
openEventStream();
79
82
EXPORTED_PUBLIC ssize_t readEvent(
int
fd, InputNotification& notification);
83
85
EXPORTED_PUBLIC
void
inhibitEvents();
86
88
EXPORTED_PUBLIC
void
uninhibitEvents();
89
93
EXPORTED_PUBLIC
void
loadKeymapFromFile(
const
char
* path);
94
};
// namespace Input
95
96
#endif
Input::InputNotification
Definition
Input.h:40
Input::InputNotification::scancode
uint8_t scancode
Definition
Input.h:67
Input::InputNotification::keyUp
bool keyUp
Whether this is a keyUp event or not.
Definition
Input.h:70
Generated on Sat Oct 3 2026 06:38:05 for The Pedigree Project by
1.9.8