forked from amagnasco/xwpe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeLinux.c
42 lines (35 loc) · 775 Bytes
/
WeLinux.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifdef __linux__
/*-------------------------------------------------------------------------*\
<WeLinux.c> -- Linux specific routines for Xwpe
Date Programmer Description
04/11/98 Dennis Created based on functions from "we_linux.c".
\*-------------------------------------------------------------------------*/
/* we_linux.c -- Created by Sebastiano Suraci */
#include <sys/ioctl.h>
int WpeLinuxBioskey(void)
{
char c;
int status;
c = 6;
status = 0;
if (ioctl(0, TIOCLINUX, &c) == 0)
{
if (c & 0x01)
{
/* Right or left shift is pressed */
status |= 0x03;
}
if (c & 0x04)
{
/* Control key is pressed */
status |= 0x04;
}
if (c & 0x0A)
{
/* Alt key is pressed */
status |= 0x08;
}
}
return(status);
}
#endif