line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id: Sonypi.pm 14 2010-06-15 17:34:55Z gomor $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package Lib::Sonypi; |
5
|
1
|
|
|
1
|
|
18757
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use base qw(Exporter DynaLoader); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1825
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.80'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->bootstrap($VERSION); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
14
|
|
|
|
|
|
|
consts => [qw( |
15
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_DOWN |
16
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_UP |
17
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_DOWN_PRESSED |
18
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_UP_PRESSED |
19
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_PRESSED |
20
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_RELEASED |
21
|
|
|
|
|
|
|
SONYPI_EVENT_CAPTURE_PRESSED |
22
|
|
|
|
|
|
|
SONYPI_EVENT_CAPTURE_RELEASED |
23
|
|
|
|
|
|
|
SONYPI_EVENT_CAPTURE_PARTIALPRESSED |
24
|
|
|
|
|
|
|
SONYPI_EVENT_CAPTURE_PARTIALRELEASED |
25
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_ESC |
26
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F1 |
27
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F2 |
28
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F3 |
29
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F4 |
30
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F5 |
31
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F6 |
32
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F7 |
33
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F8 |
34
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F9 |
35
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F10 |
36
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F11 |
37
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F12 |
38
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_1 |
39
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_2 |
40
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_D |
41
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_E |
42
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_F |
43
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_S |
44
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_B |
45
|
|
|
|
|
|
|
SONYPI_EVENT_BLUETOOTH_PRESSED |
46
|
|
|
|
|
|
|
SONYPI_EVENT_PKEY_P1 |
47
|
|
|
|
|
|
|
SONYPI_EVENT_PKEY_P2 |
48
|
|
|
|
|
|
|
SONYPI_EVENT_PKEY_P3 |
49
|
|
|
|
|
|
|
SONYPI_EVENT_BACK_PRESSED |
50
|
|
|
|
|
|
|
SONYPI_EVENT_LID_CLOSED |
51
|
|
|
|
|
|
|
SONYPI_EVENT_LID_OPENED |
52
|
|
|
|
|
|
|
SONYPI_EVENT_BLUETOOTH_ON |
53
|
|
|
|
|
|
|
SONYPI_EVENT_BLUETOOTH_OFF |
54
|
|
|
|
|
|
|
SONYPI_EVENT_HELP_PRESSED |
55
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_ONLY |
56
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_FAST_DOWN |
57
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_FAST_UP |
58
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED |
59
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED |
60
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_VFAST_DOWN |
61
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_VFAST_UP |
62
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED |
63
|
|
|
|
|
|
|
SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED |
64
|
|
|
|
|
|
|
SONYPI_EVENT_ZOOM_PRESSED |
65
|
|
|
|
|
|
|
SONYPI_EVENT_THUMBPHRASE_PRESSED |
66
|
|
|
|
|
|
|
SONYPI_EVENT_MEYE_FACE |
67
|
|
|
|
|
|
|
SONYPI_EVENT_MEYE_OPPOSITE |
68
|
|
|
|
|
|
|
SONYPI_EVENT_MEMORYSTICK_INSERT |
69
|
|
|
|
|
|
|
SONYPI_EVENT_MEMORYSTICK_EJECT |
70
|
|
|
|
|
|
|
SONYPI_EVENT_ANYBUTTON_RELEASED |
71
|
|
|
|
|
|
|
SONYPI_EVENT_BATTERY_INSERT |
72
|
|
|
|
|
|
|
SONYPI_EVENT_BATTERY_REMOVE |
73
|
|
|
|
|
|
|
SONYPI_EVENT_FNKEY_RELEASED |
74
|
|
|
|
|
|
|
SONYPI_EVENT_WIRELESS_ON |
75
|
|
|
|
|
|
|
SONYPI_EVENT_WIRELESS_OFF |
76
|
|
|
|
|
|
|
SONYPI_EVENT_ZOOM_IN_PRESSED |
77
|
|
|
|
|
|
|
SONYPI_EVENT_ZOOM_OUT_PRESSED |
78
|
|
|
|
|
|
|
SONYPI_EVENT_CD_EJECT_PRESSED |
79
|
|
|
|
|
|
|
SONYPI_EVENT_MODEKEY_PRESSED |
80
|
|
|
|
|
|
|
SONYPI_EVENT_PKEY_P4 |
81
|
|
|
|
|
|
|
SONYPI_EVENT_PKEY_P5 |
82
|
|
|
|
|
|
|
SONYPI_EVENT_SETTINGKEY_PRESSED |
83
|
|
|
|
|
|
|
SONYPI_EVENT_VOLUME_INC_PRESSED |
84
|
|
|
|
|
|
|
SONYPI_EVENT_VOLUME_DEC_PRESSED |
85
|
|
|
|
|
|
|
SONYPI_EVENT_BRIGHTNESS_PRESSED |
86
|
|
|
|
|
|
|
)], |
87
|
|
|
|
|
|
|
subs => [qw( |
88
|
|
|
|
|
|
|
getbrt |
89
|
|
|
|
|
|
|
setbrt |
90
|
|
|
|
|
|
|
getbat1cap |
91
|
|
|
|
|
|
|
getbat1rem |
92
|
|
|
|
|
|
|
getbat2cap |
93
|
|
|
|
|
|
|
getbat2rem |
94
|
|
|
|
|
|
|
getbatflags |
95
|
|
|
|
|
|
|
getblue |
96
|
|
|
|
|
|
|
setblue |
97
|
|
|
|
|
|
|
getfan |
98
|
|
|
|
|
|
|
setfan |
99
|
|
|
|
|
|
|
gettemp |
100
|
|
|
|
|
|
|
eventLoop |
101
|
|
|
|
|
|
|
)], |
102
|
|
|
|
|
|
|
vars => [qw( |
103
|
|
|
|
|
|
|
$Events |
104
|
|
|
|
|
|
|
)], |
105
|
|
|
|
|
|
|
); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
our @EXPORT_OK = ( |
108
|
|
|
|
|
|
|
@{$EXPORT_TAGS{vars}}, |
109
|
|
|
|
|
|
|
@{$EXPORT_TAGS{consts}}, |
110
|
|
|
|
|
|
|
@{$EXPORT_TAGS{subs}}, |
111
|
|
|
|
|
|
|
); |
112
|
|
|
|
|
|
|
|
113
|
1
|
|
|
1
|
|
9
|
use constant SONYPI_EVENT_JOGDIAL_DOWN => 1; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
92
|
|
114
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_JOGDIAL_UP => 2; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
115
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_JOGDIAL_DOWN_PRESSED => 3; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
116
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_UP_PRESSED => 4; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
117
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_PRESSED => 5; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
118
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_JOGDIAL_RELEASED => 6; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
54
|
|
119
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_CAPTURE_PRESSED => 7; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
120
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_CAPTURE_RELEASED => 8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
121
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_CAPTURE_PARTIALPRESSED => 9; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
122
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_CAPTURE_PARTIALRELEASED => 10; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
123
|
1
|
|
|
1
|
|
16
|
use constant SONYPI_EVENT_FNKEY_ESC => 11; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
124
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F1 => 12; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
125
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_F2 => 13; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
126
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_F3 => 14; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
127
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F4 => 15; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
40
|
|
128
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_F5 => 16; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
37
|
|
129
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F6 => 17; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
130
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F7 => 18; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
131
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_F8 => 19; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
132
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F9 => 20; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
133
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_F10 => 21; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
562
|
|
134
|
1
|
|
|
1
|
|
492
|
use constant SONYPI_EVENT_FNKEY_F11 => 22; |
|
1
|
|
|
|
|
97
|
|
|
1
|
|
|
|
|
74
|
|
135
|
1
|
|
|
1
|
|
7
|
use constant SONYPI_EVENT_FNKEY_F12 => 23; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
136
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_1 => 24; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
137
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_2 => 25; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
138
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_D => 26; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
139
|
1
|
|
|
1
|
|
36
|
use constant SONYPI_EVENT_FNKEY_E => 27; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
53
|
|
140
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_F => 28; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
141
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_S => 29; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
142
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_FNKEY_B => 30; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
47
|
|
143
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_BLUETOOTH_PRESSED => 31; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
144
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_PKEY_P1 => 32; |
|
1
|
|
|
|
|
20
|
|
|
1
|
|
|
|
|
39
|
|
145
|
1
|
|
|
1
|
|
511
|
use constant SONYPI_EVENT_PKEY_P2 => 33; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
146
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_PKEY_P3 => 34; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
147
|
1
|
|
|
1
|
|
11
|
use constant SONYPI_EVENT_BACK_PRESSED => 35; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
148
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_LID_CLOSED => 36; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
149
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_LID_OPENED => 37; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
150
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_BLUETOOTH_ON => 38; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
145
|
|
151
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_BLUETOOTH_OFF => 39; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
152
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_HELP_PRESSED => 40; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
153
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_FNKEY_ONLY => 41; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
154
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_JOGDIAL_FAST_DOWN => 42; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
155
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_FAST_UP => 43; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
156
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_FAST_DOWN_PRESSED => 44; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
157
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_FAST_UP_PRESSED => 45; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
40
|
|
158
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_VFAST_DOWN => 46; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
159
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_VFAST_UP => 47; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
160
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED => 48; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
37
|
|
161
|
1
|
|
|
1
|
|
4
|
use constant SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED => 49; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
139
|
|
162
|
1
|
|
|
1
|
|
7
|
use constant SONYPI_EVENT_ZOOM_PRESSED => 50; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
321
|
|
163
|
1
|
|
|
1
|
|
7
|
use constant SONYPI_EVENT_THUMBPHRASE_PRESSED => 51; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
164
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_MEYE_FACE => 52; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
52
|
|
165
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_MEYE_OPPOSITE => 53; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
44
|
|
166
|
1
|
|
|
1
|
|
13
|
use constant SONYPI_EVENT_MEMORYSTICK_INSERT => 54; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
167
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_MEMORYSTICK_EJECT => 55; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
55
|
|
168
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_ANYBUTTON_RELEASED => 56; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
169
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_BATTERY_INSERT => 57; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
170
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_BATTERY_REMOVE => 58; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
171
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_FNKEY_RELEASED => 59; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
172
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_WIRELESS_ON => 60; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
61
|
|
173
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_WIRELESS_OFF => 61; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
174
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_ZOOM_IN_PRESSED => 62; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
175
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_ZOOM_OUT_PRESSED => 63; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
176
|
1
|
|
|
1
|
|
6
|
use constant SONYPI_EVENT_CD_EJECT_PRESSED => 64; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
177
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_MODEKEY_PRESSED => 65; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
640
|
|
178
|
1
|
|
|
1
|
|
7
|
use constant SONYPI_EVENT_PKEY_P4 => 66; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
179
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_PKEY_P5 => 67; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
53
|
|
180
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_SETTINGKEY_PRESSED => 68; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
49
|
|
181
|
1
|
|
|
1
|
|
7
|
use constant SONYPI_EVENT_VOLUME_INC_PRESSED => 69; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
182
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_VOLUME_DEC_PRESSED => 70; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
183
|
1
|
|
|
1
|
|
5
|
use constant SONYPI_EVENT_BRIGHTNESS_PRESSED => 71; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
322
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
our $Events = {}; |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub eventLoop { |
188
|
0
|
|
|
0
|
1
|
|
my $dev = "/dev/sonypi"; |
189
|
|
|
|
|
|
|
|
190
|
0
|
0
|
|
|
|
|
open(my $fd, '<', $dev) or die("listen: open: $!"); |
191
|
0
|
|
|
|
|
|
my $rin = ''; |
192
|
0
|
|
|
|
|
|
vec($rin, fileno($fd), 1) = 1; |
193
|
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
|
while (select($rin, undef, undef, undef)) { |
195
|
0
|
|
|
|
|
|
my $ret = sysread($fd, my $ev, 1); |
196
|
0
|
0
|
|
|
|
|
if ($ret == 0) { |
197
|
0
|
|
|
|
|
|
last; |
198
|
|
|
|
|
|
|
} |
199
|
0
|
|
|
|
|
|
$ev = sprintf("%s", unpack('c', $ev)); |
200
|
|
|
|
|
|
|
#print "DEBUG: EVENT[$ev] RET[$ret]\n"; |
201
|
|
|
|
|
|
|
|
202
|
0
|
0
|
|
|
|
|
if (exists $Events->{$ev}) { |
203
|
0
|
|
|
|
|
|
&{$Events->{$ev}}(); |
|
0
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
0
|
|
|
|
|
|
close($fd); |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
1; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
__END__ |