uinput 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d86f92cb1a855196f799ac0938acbdfb8671b91c
4
- data.tar.gz: 2c8bf18dbb3c406580aeef1cc3c74d0b4007cd2f
3
+ metadata.gz: 5cd26be5f5ec42066450546bded253f2f2162c65
4
+ data.tar.gz: 5caffee633162e4a316e8c02a38d1517d0640d77
5
5
  SHA512:
6
- metadata.gz: cd33968fd9e73ae027bf36a4fe3e6f458b93386af54514f0e92a4047cf2da3f2eb08fc4acc09c6b170ae5ccd745dad0232cd1e7e8216ff4b89ef53a53e3a72dc
7
- data.tar.gz: 6304b381dd56f0828dc628aa4a62b55b5f5cc1cf9013312e5a53ee94b10f05d321f14caf41df7fcdba077d1dec28529eded54e62cda0555957c00fd3859d1040
6
+ metadata.gz: 2cc521214a9c2070b8130687a43045cbdb2a5909d8c1272d71afd9837123bbe8b83a53e09ea0e7deaf07671404009ebe37b2984ebc195642403d6c1502e0a87e
7
+ data.tar.gz: a3c60ae4bfe696384e762fb6bbeb1d4f371e565033c73855ef5822279fce3802932bee695c8cbdf40bd2a08c91a25262616bfcfe0224b468a6130c8198caa53f
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Uinput
2
2
 
3
- Structs and Constants of input, ioctrl and uinput to use uinput with ruby.
3
+ FFI Structs and Constants of to use uinput with ruby. Depends on the [linux_input](http://github.com/christopheraue/ruby-linux_input)
4
+ gem.
4
5
 
5
6
  ## Installation
6
7
 
@@ -18,7 +19,75 @@ Or install it yourself as:
18
19
 
19
20
  $ gem install uinput
20
21
 
21
- ## (Re-)Compiling the binding
22
+ ## Usage
23
+
24
+ ```ruby
25
+ require 'uinput'
26
+ ```
27
+
28
+ Creating a new virtual keyboard having an A key:
29
+
30
+ ```ruby
31
+ file = File.open('/dev/uinput', Fcntl::O_WRONLY | Fcntl::O_NDELAY)
32
+ device = Uinput::UinputUserDev.new
33
+
34
+ device[:name] = "Virtual Ruby Device"
35
+ device[:id][:type] = LinuxInput::BUS_VIRTUAL
36
+ device[:id][:vendor] = 0
37
+ device[:id][:product] = 0
38
+ device[:id][:version] = 0
39
+
40
+ file.ioctl(Uinput::UI_SET_KEYBIT, LinuxInput::KEY_A)
41
+ file.ioctl(Uinput::UI_SET_EVBIT, LinuxInput::EV_KEY)
42
+ file.ioctl(Uinput::UI_SET_EVBIT, LinuxInput::EV_SYN)
43
+
44
+ file.syswrite(device.pointer.read_bytes(device.size))
45
+ file.ioctl(Uinput::UI_DEV_CREATE)
46
+ ```
47
+
48
+ Typing an 'a' on our keyboard:
49
+
50
+ ```ruby
51
+ # key down event
52
+ event = LinuxInput::InputEvent.new
53
+ event[:time] = LinuxInput::Timeval.new
54
+ event[:time][:tv_sec] = Time.now.to_i
55
+ event[:type] = LinuxInput::EV_KEY
56
+ event[:code] = LinuxInput::KEY_A
57
+ event[:value] = 1
58
+ file.syswrite(event.pointer.read_bytes(event.size))
59
+
60
+ # sync event for key down
61
+ event = LinuxInput::InputEvent.new
62
+ event[:time] = LinuxInput::Timeval.new
63
+ event[:time][:tv_sec] = Time.now.to_i
64
+ event[:type] = LinuxInput::EV_SYN
65
+ event[:code] = LinuxInput::SYN_REPORT
66
+ event[:value] = 0
67
+ file.syswrite(event.pointer.read_bytes(event.size))
68
+
69
+ # key up event
70
+ event = LinuxInput::InputEvent.new
71
+ event[:time] = LinuxInput::Timeval.new
72
+ event[:time][:tv_sec] = Time.now.to_i
73
+ event[:type] = LinuxInput::EV_KEY
74
+ event[:code] = LinuxInput::KEY_A
75
+ event[:value] = 0
76
+ file.syswrite(event.pointer.read_bytes(event.size))
77
+
78
+ # sync event for key up
79
+ event = LinuxInput::InputEvent.new
80
+ event[:time] = LinuxInput::Timeval.new
81
+ event[:time][:tv_sec] = Time.now.to_i
82
+ event[:type] = LinuxInput::EV_SYN
83
+ event[:code] = LinuxInput::SYN_REPORT
84
+ event[:value] = 0
85
+ file.syswrite(event.pointer.read_bytes(event.size))
86
+ ```
87
+
88
+ ## (Re-)Compiling the interface on a linux machine
89
+
90
+ Reads your local linux/uinput.h
22
91
 
23
92
  ```
24
93
  $ rake ffi:generate
data/lib/uinput/uinput.rb CHANGED
@@ -1,26 +1,28 @@
1
- module Uinput
2
- class_eval File.read(File.join(File.dirname(__FILE__), 'generated/uinput.rb'))
1
+ module LinuxInput
2
+ module Uinput
3
+ class_eval File.read(File.join(File.dirname(__FILE__), 'generated/uinput.rb'))
3
4
 
4
- UI_DEV_CREATE = Ioctl.IO(UINPUT_IOCTL_BASE, 1)
5
- UI_DEV_DESTROY = Ioctl.IO(UINPUT_IOCTL_BASE, 2)
6
-
7
- UI_SET_EVBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 100, :int)
8
- UI_SET_KEYBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 101, :int)
9
- UI_SET_RELBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 102, :int)
10
- UI_SET_ABSBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 103, :int)
11
- UI_SET_MSCBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 104, :int)
12
- UI_SET_LEDBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 105, :int)
13
- UI_SET_SNDBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 106, :int)
14
- UI_SET_FFBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 107, :int)
15
- UI_SET_PHYS = Ioctl.IOW(UINPUT_IOCTL_BASE, 108, :pointer)
16
- UI_SET_SWBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 109, :int)
17
- UI_SET_PROPBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 110, :int)
18
-
19
- UI_BEGIN_FF_UPLOAD = Ioctl.IOWR(UINPUT_IOCTL_BASE, 200, UinputFfUpload.by_value)
20
- UI_END_FF_UPLOAD = Ioctl.IOW(UINPUT_IOCTL_BASE, 201, UinputFfUpload.by_value)
21
- UI_BEGIN_FF_ERASE = Ioctl.IOWR(UINPUT_IOCTL_BASE, 202, UinputFfErase.by_value)
22
- UI_END_FF_ERASE = Ioctl.IOW(UINPUT_IOCTL_BASE, 203, UinputFfErase.by_value)
23
-
24
- def self.UI_GET_SYSNAME(len) Ioctl.IOC(Ioctl::IOC_READ, UINPUT_IOCTL_BASE, 300, len) end
25
- UI_GET_VERSION = Ioctl.IOR(UINPUT_IOCTL_BASE, 301, :uint)
5
+ UI_DEV_CREATE = Ioctl.IO(UINPUT_IOCTL_BASE, 1)
6
+ UI_DEV_DESTROY = Ioctl.IO(UINPUT_IOCTL_BASE, 2)
7
+
8
+ UI_SET_EVBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 100, :int)
9
+ UI_SET_KEYBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 101, :int)
10
+ UI_SET_RELBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 102, :int)
11
+ UI_SET_ABSBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 103, :int)
12
+ UI_SET_MSCBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 104, :int)
13
+ UI_SET_LEDBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 105, :int)
14
+ UI_SET_SNDBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 106, :int)
15
+ UI_SET_FFBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 107, :int)
16
+ UI_SET_PHYS = Ioctl.IOW(UINPUT_IOCTL_BASE, 108, :pointer)
17
+ UI_SET_SWBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 109, :int)
18
+ UI_SET_PROPBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 110, :int)
19
+
20
+ UI_BEGIN_FF_UPLOAD = Ioctl.IOWR(UINPUT_IOCTL_BASE, 200, UinputFfUpload.by_value)
21
+ UI_END_FF_UPLOAD = Ioctl.IOW(UINPUT_IOCTL_BASE, 201, UinputFfUpload.by_value)
22
+ UI_BEGIN_FF_ERASE = Ioctl.IOWR(UINPUT_IOCTL_BASE, 202, UinputFfErase.by_value)
23
+ UI_END_FF_ERASE = Ioctl.IOW(UINPUT_IOCTL_BASE, 203, UinputFfErase.by_value)
24
+
25
+ def self.UI_GET_SYSNAME(len) Ioctl.IOC(Ioctl::IOC_READ, UINPUT_IOCTL_BASE, 300, len) end
26
+ UI_GET_VERSION = Ioctl.IOR(UINPUT_IOCTL_BASE, 301, :uint)
27
+ end
26
28
  end
@@ -1,3 +1,3 @@
1
1
  module Uinput
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/uinput.rb CHANGED
@@ -1,10 +1,6 @@
1
+ require 'bundler/setup'
2
+ require 'linux_input'
1
3
  require "uinput/version"
2
- require 'ffi'
3
-
4
- module Uinput
5
-
6
- end
7
-
8
- require 'uinput/ioctl.rb'
9
- require 'uinput/input.rb'
10
4
  require 'uinput/uinput.rb'
5
+
6
+ Uinput = LinuxInput::Uinput
data/tasks/ffi.rake CHANGED
@@ -1,20 +1,13 @@
1
1
  namespace :ffi do
2
2
  desc 'Generate ffi interface'
3
3
  task :generate do
4
- `swig -xml -o ioctl_wrap.xml -I/usr/include swig/ioctl.i`
5
- `swig -xml -o input_wrap.xml -I/usr/include swig/input.i`
6
4
  `swig -xml -o uinput_wrap.xml -I/usr/include swig/uinput.i`
7
5
 
8
- `ffi-gen ioctl_wrap.xml lib/uinput/generated/ioctl.rb`
9
- `ffi-gen input_wrap.xml lib/uinput/generated/input.rb`
10
6
  `ffi-gen uinput_wrap.xml lib/uinput/generated/uinput.rb`
11
7
 
12
- `sed -i 's/\\([0-9]\\)U/\\1/g' lib/uinput/generated/ioctl.rb`
13
- `sed -i 's/_IO/IO/g' lib/uinput/generated/ioctl.rb`
14
- `sed -i 's/ff_effect_u/FfEffectU/g' lib/uinput/generated/input.rb`
15
8
  `sed -i 's/UINPUT_IOCTL_BASE = U/UINPUT_IOCTL_BASE = ?U.ord/g' lib/uinput/generated/uinput.rb`
16
9
  `sed -i 's/a(ABS_CNT).__s32/[:int, ABS_CNT]/g' lib/uinput/generated/uinput.rb`
17
10
 
18
- `rm -f ioctl_wrap.xml uinput_wrap.xml input_wrap.xml`
11
+ `rm -f uinput_wrap.xml`
19
12
  end
20
13
  end
data/uinput.gemspec CHANGED
@@ -9,14 +9,14 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Christopher Aue"]
10
10
  spec.email = ["mail@christopheraue.net"]
11
11
 
12
- spec.summary = %q{Structs and Constants of input, ioctrl and uinput to use uinput with ruby.}
12
+ spec.summary = %q{Structs and Constants to use uinput with ruby.}
13
13
  spec.homepage = "http://github.com/christopheraue/ruby-uinput"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_runtime_dependency 'ffi', '~> 1.9'
19
+ spec.add_runtime_dependency 'linux_input', '~> 1.0'
20
20
  spec.add_development_dependency "bundler", "~> 1.8"
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
  spec.add_development_dependency "ffi-swig-generator", '~> 0'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uinput
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ffi
14
+ name: linux_input
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,15 +80,9 @@ files:
80
80
  - README.md
81
81
  - Rakefile
82
82
  - lib/uinput.rb
83
- - lib/uinput/generated/input.rb
84
- - lib/uinput/generated/ioctl.rb
85
83
  - lib/uinput/generated/uinput.rb
86
- - lib/uinput/input.rb
87
- - lib/uinput/ioctl.rb
88
84
  - lib/uinput/uinput.rb
89
85
  - lib/uinput/version.rb
90
- - swig/input.i
91
- - swig/ioctl.i
92
86
  - swig/uinput.i
93
87
  - tasks/ffi.rake
94
88
  - uinput.gemspec
@@ -115,5 +109,5 @@ rubyforge_project:
115
109
  rubygems_version: 2.4.8
116
110
  signing_key:
117
111
  specification_version: 4
118
- summary: Structs and Constants of input, ioctrl and uinput to use uinput with ruby.
112
+ summary: Structs and Constants to use uinput with ruby.
119
113
  test_files: []
@@ -1,837 +0,0 @@
1
- class InputEvent < FFI::Struct
2
- layout(
3
- :time, Timeval,
4
- :type, :ushort,
5
- :code, :ushort,
6
- :value, :int
7
- )
8
- end
9
- EV_VERSION = 0x010001
10
- class InputId < FFI::Struct
11
- layout(
12
- :bustype, :ushort,
13
- :vendor, :ushort,
14
- :product, :ushort,
15
- :version, :ushort
16
- )
17
- end
18
- class InputAbsinfo < FFI::Struct
19
- layout(
20
- :value, :int,
21
- :minimum, :int,
22
- :maximum, :int,
23
- :fuzz, :int,
24
- :flat, :int,
25
- :resolution, :int
26
- )
27
- end
28
- INPUT_KEYMAP_BY_INDEX = (1 << 0)
29
- class InputKeymapEntry < FFI::Struct
30
- layout(
31
- :flags, :uchar,
32
- :len, :uchar,
33
- :index, :ushort,
34
- :keycode, :uint,
35
- :scancode, [:uchar, 32]
36
- )
37
- end
38
- INPUT_PROP_POINTER = 0x00
39
- INPUT_PROP_DIRECT = 0x01
40
- INPUT_PROP_BUTTONPAD = 0x02
41
- INPUT_PROP_SEMI_MT = 0x03
42
- INPUT_PROP_TOPBUTTONPAD = 0x04
43
- INPUT_PROP_POINTING_STICK = 0x05
44
- INPUT_PROP_MAX = 0x1f
45
- INPUT_PROP_CNT = (0x1f+1)
46
- EV_SYN = 0x00
47
- EV_KEY = 0x01
48
- EV_REL = 0x02
49
- EV_ABS = 0x03
50
- EV_MSC = 0x04
51
- EV_SW = 0x05
52
- EV_LED = 0x11
53
- EV_SND = 0x12
54
- EV_REP = 0x14
55
- EV_FF = 0x15
56
- EV_PWR = 0x16
57
- EV_FF_STATUS = 0x17
58
- EV_MAX = 0x1f
59
- EV_CNT = (0x1f+1)
60
- SYN_REPORT = 0
61
- SYN_CONFIG = 1
62
- SYN_MT_REPORT = 2
63
- SYN_DROPPED = 3
64
- SYN_MAX = 0xf
65
- SYN_CNT = (0xf+1)
66
- KEY_RESERVED = 0
67
- KEY_ESC = 1
68
- KEY_1 = 2
69
- KEY_2 = 3
70
- KEY_3 = 4
71
- KEY_4 = 5
72
- KEY_5 = 6
73
- KEY_6 = 7
74
- KEY_7 = 8
75
- KEY_8 = 9
76
- KEY_9 = 10
77
- KEY_0 = 11
78
- KEY_MINUS = 12
79
- KEY_EQUAL = 13
80
- KEY_BACKSPACE = 14
81
- KEY_TAB = 15
82
- KEY_Q = 16
83
- KEY_W = 17
84
- KEY_E = 18
85
- KEY_R = 19
86
- KEY_T = 20
87
- KEY_Y = 21
88
- KEY_U = 22
89
- KEY_I = 23
90
- KEY_O = 24
91
- KEY_P = 25
92
- KEY_LEFTBRACE = 26
93
- KEY_RIGHTBRACE = 27
94
- KEY_ENTER = 28
95
- KEY_LEFTCTRL = 29
96
- KEY_A = 30
97
- KEY_S = 31
98
- KEY_D = 32
99
- KEY_F = 33
100
- KEY_G = 34
101
- KEY_H = 35
102
- KEY_J = 36
103
- KEY_K = 37
104
- KEY_L = 38
105
- KEY_SEMICOLON = 39
106
- KEY_APOSTROPHE = 40
107
- KEY_GRAVE = 41
108
- KEY_LEFTSHIFT = 42
109
- KEY_BACKSLASH = 43
110
- KEY_Z = 44
111
- KEY_X = 45
112
- KEY_C = 46
113
- KEY_V = 47
114
- KEY_B = 48
115
- KEY_N = 49
116
- KEY_M = 50
117
- KEY_COMMA = 51
118
- KEY_DOT = 52
119
- KEY_SLASH = 53
120
- KEY_RIGHTSHIFT = 54
121
- KEY_KPASTERISK = 55
122
- KEY_LEFTALT = 56
123
- KEY_SPACE = 57
124
- KEY_CAPSLOCK = 58
125
- KEY_F1 = 59
126
- KEY_F2 = 60
127
- KEY_F3 = 61
128
- KEY_F4 = 62
129
- KEY_F5 = 63
130
- KEY_F6 = 64
131
- KEY_F7 = 65
132
- KEY_F8 = 66
133
- KEY_F9 = 67
134
- KEY_F10 = 68
135
- KEY_NUMLOCK = 69
136
- KEY_SCROLLLOCK = 70
137
- KEY_KP7 = 71
138
- KEY_KP8 = 72
139
- KEY_KP9 = 73
140
- KEY_KPMINUS = 74
141
- KEY_KP4 = 75
142
- KEY_KP5 = 76
143
- KEY_KP6 = 77
144
- KEY_KPPLUS = 78
145
- KEY_KP1 = 79
146
- KEY_KP2 = 80
147
- KEY_KP3 = 81
148
- KEY_KP0 = 82
149
- KEY_KPDOT = 83
150
- KEY_ZENKAKUHANKAKU = 85
151
- KEY_102ND = 86
152
- KEY_F11 = 87
153
- KEY_F12 = 88
154
- KEY_RO = 89
155
- KEY_KATAKANA = 90
156
- KEY_HIRAGANA = 91
157
- KEY_HENKAN = 92
158
- KEY_KATAKANAHIRAGANA = 93
159
- KEY_MUHENKAN = 94
160
- KEY_KPJPCOMMA = 95
161
- KEY_KPENTER = 96
162
- KEY_RIGHTCTRL = 97
163
- KEY_KPSLASH = 98
164
- KEY_SYSRQ = 99
165
- KEY_RIGHTALT = 100
166
- KEY_LINEFEED = 101
167
- KEY_HOME = 102
168
- KEY_UP = 103
169
- KEY_PAGEUP = 104
170
- KEY_LEFT = 105
171
- KEY_RIGHT = 106
172
- KEY_END = 107
173
- KEY_DOWN = 108
174
- KEY_PAGEDOWN = 109
175
- KEY_INSERT = 110
176
- KEY_DELETE = 111
177
- KEY_MACRO = 112
178
- KEY_MUTE = 113
179
- KEY_VOLUMEDOWN = 114
180
- KEY_VOLUMEUP = 115
181
- KEY_POWER = 116
182
- KEY_KPEQUAL = 117
183
- KEY_KPPLUSMINUS = 118
184
- KEY_PAUSE = 119
185
- KEY_SCALE = 120
186
- KEY_KPCOMMA = 121
187
- KEY_HANGEUL = 122
188
- KEY_HANGUEL = 122
189
- KEY_HANJA = 123
190
- KEY_YEN = 124
191
- KEY_LEFTMETA = 125
192
- KEY_RIGHTMETA = 126
193
- KEY_COMPOSE = 127
194
- KEY_STOP = 128
195
- KEY_AGAIN = 129
196
- KEY_PROPS = 130
197
- KEY_UNDO = 131
198
- KEY_FRONT = 132
199
- KEY_COPY = 133
200
- KEY_OPEN = 134
201
- KEY_PASTE = 135
202
- KEY_FIND = 136
203
- KEY_CUT = 137
204
- KEY_HELP = 138
205
- KEY_MENU = 139
206
- KEY_CALC = 140
207
- KEY_SETUP = 141
208
- KEY_SLEEP = 142
209
- KEY_WAKEUP = 143
210
- KEY_FILE = 144
211
- KEY_SENDFILE = 145
212
- KEY_DELETEFILE = 146
213
- KEY_XFER = 147
214
- KEY_PROG1 = 148
215
- KEY_PROG2 = 149
216
- KEY_WWW = 150
217
- KEY_MSDOS = 151
218
- KEY_COFFEE = 152
219
- KEY_SCREENLOCK = 152
220
- KEY_DIRECTION = 153
221
- KEY_CYCLEWINDOWS = 154
222
- KEY_MAIL = 155
223
- KEY_BOOKMARKS = 156
224
- KEY_COMPUTER = 157
225
- KEY_BACK = 158
226
- KEY_FORWARD = 159
227
- KEY_CLOSECD = 160
228
- KEY_EJECTCD = 161
229
- KEY_EJECTCLOSECD = 162
230
- KEY_NEXTSONG = 163
231
- KEY_PLAYPAUSE = 164
232
- KEY_PREVIOUSSONG = 165
233
- KEY_STOPCD = 166
234
- KEY_RECORD = 167
235
- KEY_REWIND = 168
236
- KEY_PHONE = 169
237
- KEY_ISO = 170
238
- KEY_CONFIG = 171
239
- KEY_HOMEPAGE = 172
240
- KEY_REFRESH = 173
241
- KEY_EXIT = 174
242
- KEY_MOVE = 175
243
- KEY_EDIT = 176
244
- KEY_SCROLLUP = 177
245
- KEY_SCROLLDOWN = 178
246
- KEY_KPLEFTPAREN = 179
247
- KEY_KPRIGHTPAREN = 180
248
- KEY_NEW = 181
249
- KEY_REDO = 182
250
- KEY_F13 = 183
251
- KEY_F14 = 184
252
- KEY_F15 = 185
253
- KEY_F16 = 186
254
- KEY_F17 = 187
255
- KEY_F18 = 188
256
- KEY_F19 = 189
257
- KEY_F20 = 190
258
- KEY_F21 = 191
259
- KEY_F22 = 192
260
- KEY_F23 = 193
261
- KEY_F24 = 194
262
- KEY_PLAYCD = 200
263
- KEY_PAUSECD = 201
264
- KEY_PROG3 = 202
265
- KEY_PROG4 = 203
266
- KEY_DASHBOARD = 204
267
- KEY_SUSPEND = 205
268
- KEY_CLOSE = 206
269
- KEY_PLAY = 207
270
- KEY_FASTFORWARD = 208
271
- KEY_BASSBOOST = 209
272
- KEY_PRINT = 210
273
- KEY_HP = 211
274
- KEY_CAMERA = 212
275
- KEY_SOUND = 213
276
- KEY_QUESTION = 214
277
- KEY_EMAIL = 215
278
- KEY_CHAT = 216
279
- KEY_SEARCH = 217
280
- KEY_CONNECT = 218
281
- KEY_FINANCE = 219
282
- KEY_SPORT = 220
283
- KEY_SHOP = 221
284
- KEY_ALTERASE = 222
285
- KEY_CANCEL = 223
286
- KEY_BRIGHTNESSDOWN = 224
287
- KEY_BRIGHTNESSUP = 225
288
- KEY_MEDIA = 226
289
- KEY_SWITCHVIDEOMODE = 227
290
- KEY_KBDILLUMTOGGLE = 228
291
- KEY_KBDILLUMDOWN = 229
292
- KEY_KBDILLUMUP = 230
293
- KEY_SEND = 231
294
- KEY_REPLY = 232
295
- KEY_FORWARDMAIL = 233
296
- KEY_SAVE = 234
297
- KEY_DOCUMENTS = 235
298
- KEY_BATTERY = 236
299
- KEY_BLUETOOTH = 237
300
- KEY_WLAN = 238
301
- KEY_UWB = 239
302
- KEY_UNKNOWN = 240
303
- KEY_VIDEO_NEXT = 241
304
- KEY_VIDEO_PREV = 242
305
- KEY_BRIGHTNESS_CYCLE = 243
306
- KEY_BRIGHTNESS_AUTO = 244
307
- KEY_BRIGHTNESS_ZERO = 244
308
- KEY_DISPLAY_OFF = 245
309
- KEY_WWAN = 246
310
- KEY_WIMAX = 246
311
- KEY_RFKILL = 247
312
- KEY_MICMUTE = 248
313
- BTN_MISC = 0x100
314
- BTN_0 = 0x100
315
- BTN_1 = 0x101
316
- BTN_2 = 0x102
317
- BTN_3 = 0x103
318
- BTN_4 = 0x104
319
- BTN_5 = 0x105
320
- BTN_6 = 0x106
321
- BTN_7 = 0x107
322
- BTN_8 = 0x108
323
- BTN_9 = 0x109
324
- BTN_MOUSE = 0x110
325
- BTN_LEFT = 0x110
326
- BTN_RIGHT = 0x111
327
- BTN_MIDDLE = 0x112
328
- BTN_SIDE = 0x113
329
- BTN_EXTRA = 0x114
330
- BTN_FORWARD = 0x115
331
- BTN_BACK = 0x116
332
- BTN_TASK = 0x117
333
- BTN_JOYSTICK = 0x120
334
- BTN_TRIGGER = 0x120
335
- BTN_THUMB = 0x121
336
- BTN_THUMB2 = 0x122
337
- BTN_TOP = 0x123
338
- BTN_TOP2 = 0x124
339
- BTN_PINKIE = 0x125
340
- BTN_BASE = 0x126
341
- BTN_BASE2 = 0x127
342
- BTN_BASE3 = 0x128
343
- BTN_BASE4 = 0x129
344
- BTN_BASE5 = 0x12a
345
- BTN_BASE6 = 0x12b
346
- BTN_DEAD = 0x12f
347
- BTN_GAMEPAD = 0x130
348
- BTN_SOUTH = 0x130
349
- BTN_A = 0x130
350
- BTN_EAST = 0x131
351
- BTN_B = 0x131
352
- BTN_C = 0x132
353
- BTN_NORTH = 0x133
354
- BTN_X = 0x133
355
- BTN_WEST = 0x134
356
- BTN_Y = 0x134
357
- BTN_Z = 0x135
358
- BTN_TL = 0x136
359
- BTN_TR = 0x137
360
- BTN_TL2 = 0x138
361
- BTN_TR2 = 0x139
362
- BTN_SELECT = 0x13a
363
- BTN_START = 0x13b
364
- BTN_MODE = 0x13c
365
- BTN_THUMBL = 0x13d
366
- BTN_THUMBR = 0x13e
367
- BTN_DIGI = 0x140
368
- BTN_TOOL_PEN = 0x140
369
- BTN_TOOL_RUBBER = 0x141
370
- BTN_TOOL_BRUSH = 0x142
371
- BTN_TOOL_PENCIL = 0x143
372
- BTN_TOOL_AIRBRUSH = 0x144
373
- BTN_TOOL_FINGER = 0x145
374
- BTN_TOOL_MOUSE = 0x146
375
- BTN_TOOL_LENS = 0x147
376
- BTN_TOOL_QUINTTAP = 0x148
377
- BTN_TOUCH = 0x14a
378
- BTN_STYLUS = 0x14b
379
- BTN_STYLUS2 = 0x14c
380
- BTN_TOOL_DOUBLETAP = 0x14d
381
- BTN_TOOL_TRIPLETAP = 0x14e
382
- BTN_TOOL_QUADTAP = 0x14f
383
- BTN_WHEEL = 0x150
384
- BTN_GEAR_DOWN = 0x150
385
- BTN_GEAR_UP = 0x151
386
- KEY_OK = 0x160
387
- KEY_SELECT = 0x161
388
- KEY_GOTO = 0x162
389
- KEY_CLEAR = 0x163
390
- KEY_POWER2 = 0x164
391
- KEY_OPTION = 0x165
392
- KEY_INFO = 0x166
393
- KEY_TIME = 0x167
394
- KEY_VENDOR = 0x168
395
- KEY_ARCHIVE = 0x169
396
- KEY_PROGRAM = 0x16a
397
- KEY_CHANNEL = 0x16b
398
- KEY_FAVORITES = 0x16c
399
- KEY_EPG = 0x16d
400
- KEY_PVR = 0x16e
401
- KEY_MHP = 0x16f
402
- KEY_LANGUAGE = 0x170
403
- KEY_TITLE = 0x171
404
- KEY_SUBTITLE = 0x172
405
- KEY_ANGLE = 0x173
406
- KEY_ZOOM = 0x174
407
- KEY_MODE = 0x175
408
- KEY_KEYBOARD = 0x176
409
- KEY_SCREEN = 0x177
410
- KEY_PC = 0x178
411
- KEY_TV = 0x179
412
- KEY_TV2 = 0x17a
413
- KEY_VCR = 0x17b
414
- KEY_VCR2 = 0x17c
415
- KEY_SAT = 0x17d
416
- KEY_SAT2 = 0x17e
417
- KEY_CD = 0x17f
418
- KEY_TAPE = 0x180
419
- KEY_RADIO = 0x181
420
- KEY_TUNER = 0x182
421
- KEY_PLAYER = 0x183
422
- KEY_TEXT = 0x184
423
- KEY_DVD = 0x185
424
- KEY_AUX = 0x186
425
- KEY_MP3 = 0x187
426
- KEY_AUDIO = 0x188
427
- KEY_VIDEO = 0x189
428
- KEY_DIRECTORY = 0x18a
429
- KEY_LIST = 0x18b
430
- KEY_MEMO = 0x18c
431
- KEY_CALENDAR = 0x18d
432
- KEY_RED = 0x18e
433
- KEY_GREEN = 0x18f
434
- KEY_YELLOW = 0x190
435
- KEY_BLUE = 0x191
436
- KEY_CHANNELUP = 0x192
437
- KEY_CHANNELDOWN = 0x193
438
- KEY_FIRST = 0x194
439
- KEY_LAST = 0x195
440
- KEY_AB = 0x196
441
- KEY_NEXT = 0x197
442
- KEY_RESTART = 0x198
443
- KEY_SLOW = 0x199
444
- KEY_SHUFFLE = 0x19a
445
- KEY_BREAK = 0x19b
446
- KEY_PREVIOUS = 0x19c
447
- KEY_DIGITS = 0x19d
448
- KEY_TEEN = 0x19e
449
- KEY_TWEN = 0x19f
450
- KEY_VIDEOPHONE = 0x1a0
451
- KEY_GAMES = 0x1a1
452
- KEY_ZOOMIN = 0x1a2
453
- KEY_ZOOMOUT = 0x1a3
454
- KEY_ZOOMRESET = 0x1a4
455
- KEY_WORDPROCESSOR = 0x1a5
456
- KEY_EDITOR = 0x1a6
457
- KEY_SPREADSHEET = 0x1a7
458
- KEY_GRAPHICSEDITOR = 0x1a8
459
- KEY_PRESENTATION = 0x1a9
460
- KEY_DATABASE = 0x1aa
461
- KEY_NEWS = 0x1ab
462
- KEY_VOICEMAIL = 0x1ac
463
- KEY_ADDRESSBOOK = 0x1ad
464
- KEY_MESSENGER = 0x1ae
465
- KEY_DISPLAYTOGGLE = 0x1af
466
- KEY_BRIGHTNESS_TOGGLE = 0x1af
467
- KEY_SPELLCHECK = 0x1b0
468
- KEY_LOGOFF = 0x1b1
469
- KEY_DOLLAR = 0x1b2
470
- KEY_EURO = 0x1b3
471
- KEY_FRAMEBACK = 0x1b4
472
- KEY_FRAMEFORWARD = 0x1b5
473
- KEY_CONTEXT_MENU = 0x1b6
474
- KEY_MEDIA_REPEAT = 0x1b7
475
- KEY_10CHANNELSUP = 0x1b8
476
- KEY_10CHANNELSDOWN = 0x1b9
477
- KEY_IMAGES = 0x1ba
478
- KEY_DEL_EOL = 0x1c0
479
- KEY_DEL_EOS = 0x1c1
480
- KEY_INS_LINE = 0x1c2
481
- KEY_DEL_LINE = 0x1c3
482
- KEY_FN = 0x1d0
483
- KEY_FN_ESC = 0x1d1
484
- KEY_FN_F1 = 0x1d2
485
- KEY_FN_F2 = 0x1d3
486
- KEY_FN_F3 = 0x1d4
487
- KEY_FN_F4 = 0x1d5
488
- KEY_FN_F5 = 0x1d6
489
- KEY_FN_F6 = 0x1d7
490
- KEY_FN_F7 = 0x1d8
491
- KEY_FN_F8 = 0x1d9
492
- KEY_FN_F9 = 0x1da
493
- KEY_FN_F10 = 0x1db
494
- KEY_FN_F11 = 0x1dc
495
- KEY_FN_F12 = 0x1dd
496
- KEY_FN_1 = 0x1de
497
- KEY_FN_2 = 0x1df
498
- KEY_FN_D = 0x1e0
499
- KEY_FN_E = 0x1e1
500
- KEY_FN_F = 0x1e2
501
- KEY_FN_S = 0x1e3
502
- KEY_FN_B = 0x1e4
503
- KEY_BRL_DOT1 = 0x1f1
504
- KEY_BRL_DOT2 = 0x1f2
505
- KEY_BRL_DOT3 = 0x1f3
506
- KEY_BRL_DOT4 = 0x1f4
507
- KEY_BRL_DOT5 = 0x1f5
508
- KEY_BRL_DOT6 = 0x1f6
509
- KEY_BRL_DOT7 = 0x1f7
510
- KEY_BRL_DOT8 = 0x1f8
511
- KEY_BRL_DOT9 = 0x1f9
512
- KEY_BRL_DOT10 = 0x1fa
513
- KEY_NUMERIC_0 = 0x200
514
- KEY_NUMERIC_1 = 0x201
515
- KEY_NUMERIC_2 = 0x202
516
- KEY_NUMERIC_3 = 0x203
517
- KEY_NUMERIC_4 = 0x204
518
- KEY_NUMERIC_5 = 0x205
519
- KEY_NUMERIC_6 = 0x206
520
- KEY_NUMERIC_7 = 0x207
521
- KEY_NUMERIC_8 = 0x208
522
- KEY_NUMERIC_9 = 0x209
523
- KEY_NUMERIC_STAR = 0x20a
524
- KEY_NUMERIC_POUND = 0x20b
525
- KEY_CAMERA_FOCUS = 0x210
526
- KEY_WPS_BUTTON = 0x211
527
- KEY_TOUCHPAD_TOGGLE = 0x212
528
- KEY_TOUCHPAD_ON = 0x213
529
- KEY_TOUCHPAD_OFF = 0x214
530
- KEY_CAMERA_ZOOMIN = 0x215
531
- KEY_CAMERA_ZOOMOUT = 0x216
532
- KEY_CAMERA_UP = 0x217
533
- KEY_CAMERA_DOWN = 0x218
534
- KEY_CAMERA_LEFT = 0x219
535
- KEY_CAMERA_RIGHT = 0x21a
536
- KEY_ATTENDANT_ON = 0x21b
537
- KEY_ATTENDANT_OFF = 0x21c
538
- KEY_ATTENDANT_TOGGLE = 0x21d
539
- KEY_LIGHTS_TOGGLE = 0x21e
540
- BTN_DPAD_UP = 0x220
541
- BTN_DPAD_DOWN = 0x221
542
- BTN_DPAD_LEFT = 0x222
543
- BTN_DPAD_RIGHT = 0x223
544
- KEY_ALS_TOGGLE = 0x230
545
- KEY_BUTTONCONFIG = 0x240
546
- KEY_TASKMANAGER = 0x241
547
- KEY_JOURNAL = 0x242
548
- KEY_CONTROLPANEL = 0x243
549
- KEY_APPSELECT = 0x244
550
- KEY_SCREENSAVER = 0x245
551
- KEY_VOICECOMMAND = 0x246
552
- KEY_BRIGHTNESS_MIN = 0x250
553
- KEY_BRIGHTNESS_MAX = 0x251
554
- KEY_KBDINPUTASSIST_PREV = 0x260
555
- KEY_KBDINPUTASSIST_NEXT = 0x261
556
- KEY_KBDINPUTASSIST_PREVGROUP = 0x262
557
- KEY_KBDINPUTASSIST_NEXTGROUP = 0x263
558
- KEY_KBDINPUTASSIST_ACCEPT = 0x264
559
- KEY_KBDINPUTASSIST_CANCEL = 0x265
560
- BTN_TRIGGER_HAPPY = 0x2c0
561
- BTN_TRIGGER_HAPPY1 = 0x2c0
562
- BTN_TRIGGER_HAPPY2 = 0x2c1
563
- BTN_TRIGGER_HAPPY3 = 0x2c2
564
- BTN_TRIGGER_HAPPY4 = 0x2c3
565
- BTN_TRIGGER_HAPPY5 = 0x2c4
566
- BTN_TRIGGER_HAPPY6 = 0x2c5
567
- BTN_TRIGGER_HAPPY7 = 0x2c6
568
- BTN_TRIGGER_HAPPY8 = 0x2c7
569
- BTN_TRIGGER_HAPPY9 = 0x2c8
570
- BTN_TRIGGER_HAPPY10 = 0x2c9
571
- BTN_TRIGGER_HAPPY11 = 0x2ca
572
- BTN_TRIGGER_HAPPY12 = 0x2cb
573
- BTN_TRIGGER_HAPPY13 = 0x2cc
574
- BTN_TRIGGER_HAPPY14 = 0x2cd
575
- BTN_TRIGGER_HAPPY15 = 0x2ce
576
- BTN_TRIGGER_HAPPY16 = 0x2cf
577
- BTN_TRIGGER_HAPPY17 = 0x2d0
578
- BTN_TRIGGER_HAPPY18 = 0x2d1
579
- BTN_TRIGGER_HAPPY19 = 0x2d2
580
- BTN_TRIGGER_HAPPY20 = 0x2d3
581
- BTN_TRIGGER_HAPPY21 = 0x2d4
582
- BTN_TRIGGER_HAPPY22 = 0x2d5
583
- BTN_TRIGGER_HAPPY23 = 0x2d6
584
- BTN_TRIGGER_HAPPY24 = 0x2d7
585
- BTN_TRIGGER_HAPPY25 = 0x2d8
586
- BTN_TRIGGER_HAPPY26 = 0x2d9
587
- BTN_TRIGGER_HAPPY27 = 0x2da
588
- BTN_TRIGGER_HAPPY28 = 0x2db
589
- BTN_TRIGGER_HAPPY29 = 0x2dc
590
- BTN_TRIGGER_HAPPY30 = 0x2dd
591
- BTN_TRIGGER_HAPPY31 = 0x2de
592
- BTN_TRIGGER_HAPPY32 = 0x2df
593
- BTN_TRIGGER_HAPPY33 = 0x2e0
594
- BTN_TRIGGER_HAPPY34 = 0x2e1
595
- BTN_TRIGGER_HAPPY35 = 0x2e2
596
- BTN_TRIGGER_HAPPY36 = 0x2e3
597
- BTN_TRIGGER_HAPPY37 = 0x2e4
598
- BTN_TRIGGER_HAPPY38 = 0x2e5
599
- BTN_TRIGGER_HAPPY39 = 0x2e6
600
- BTN_TRIGGER_HAPPY40 = 0x2e7
601
- KEY_MIN_INTERESTING = 113
602
- KEY_MAX = 0x2ff
603
- KEY_CNT = (0x2ff+1)
604
- REL_X = 0x00
605
- REL_Y = 0x01
606
- REL_Z = 0x02
607
- REL_RX = 0x03
608
- REL_RY = 0x04
609
- REL_RZ = 0x05
610
- REL_HWHEEL = 0x06
611
- REL_DIAL = 0x07
612
- REL_WHEEL = 0x08
613
- REL_MISC = 0x09
614
- REL_MAX = 0x0f
615
- REL_CNT = (0x0f+1)
616
- ABS_X = 0x00
617
- ABS_Y = 0x01
618
- ABS_Z = 0x02
619
- ABS_RX = 0x03
620
- ABS_RY = 0x04
621
- ABS_RZ = 0x05
622
- ABS_THROTTLE = 0x06
623
- ABS_RUDDER = 0x07
624
- ABS_WHEEL = 0x08
625
- ABS_GAS = 0x09
626
- ABS_BRAKE = 0x0a
627
- ABS_HAT0X = 0x10
628
- ABS_HAT0Y = 0x11
629
- ABS_HAT1X = 0x12
630
- ABS_HAT1Y = 0x13
631
- ABS_HAT2X = 0x14
632
- ABS_HAT2Y = 0x15
633
- ABS_HAT3X = 0x16
634
- ABS_HAT3Y = 0x17
635
- ABS_PRESSURE = 0x18
636
- ABS_DISTANCE = 0x19
637
- ABS_TILT_X = 0x1a
638
- ABS_TILT_Y = 0x1b
639
- ABS_TOOL_WIDTH = 0x1c
640
- ABS_VOLUME = 0x20
641
- ABS_MISC = 0x28
642
- ABS_MT_SLOT = 0x2f
643
- ABS_MT_TOUCH_MAJOR = 0x30
644
- ABS_MT_TOUCH_MINOR = 0x31
645
- ABS_MT_WIDTH_MAJOR = 0x32
646
- ABS_MT_WIDTH_MINOR = 0x33
647
- ABS_MT_ORIENTATION = 0x34
648
- ABS_MT_POSITION_X = 0x35
649
- ABS_MT_POSITION_Y = 0x36
650
- ABS_MT_TOOL_TYPE = 0x37
651
- ABS_MT_BLOB_ID = 0x38
652
- ABS_MT_TRACKING_ID = 0x39
653
- ABS_MT_PRESSURE = 0x3a
654
- ABS_MT_DISTANCE = 0x3b
655
- ABS_MT_TOOL_X = 0x3c
656
- ABS_MT_TOOL_Y = 0x3d
657
- ABS_MAX = 0x3f
658
- ABS_CNT = (0x3f+1)
659
- SW_LID = 0x00
660
- SW_TABLET_MODE = 0x01
661
- SW_HEADPHONE_INSERT = 0x02
662
- SW_RFKILL_ALL = 0x03
663
- SW_RADIO = 0x03
664
- SW_MICROPHONE_INSERT = 0x04
665
- SW_DOCK = 0x05
666
- SW_LINEOUT_INSERT = 0x06
667
- SW_JACK_PHYSICAL_INSERT = 0x07
668
- SW_VIDEOOUT_INSERT = 0x08
669
- SW_CAMERA_LENS_COVER = 0x09
670
- SW_KEYPAD_SLIDE = 0x0a
671
- SW_FRONT_PROXIMITY = 0x0b
672
- SW_ROTATE_LOCK = 0x0c
673
- SW_LINEIN_INSERT = 0x0d
674
- SW_MUTE_DEVICE = 0x0e
675
- SW_MAX = 0x0f
676
- SW_CNT = (0x0f+1)
677
- MSC_SERIAL = 0x00
678
- MSC_PULSELED = 0x01
679
- MSC_GESTURE = 0x02
680
- MSC_RAW = 0x03
681
- MSC_SCAN = 0x04
682
- MSC_TIMESTAMP = 0x05
683
- MSC_MAX = 0x07
684
- MSC_CNT = (0x07+1)
685
- LED_NUML = 0x00
686
- LED_CAPSL = 0x01
687
- LED_SCROLLL = 0x02
688
- LED_COMPOSE = 0x03
689
- LED_KANA = 0x04
690
- LED_SLEEP = 0x05
691
- LED_SUSPEND = 0x06
692
- LED_MUTE = 0x07
693
- LED_MISC = 0x08
694
- LED_MAIL = 0x09
695
- LED_CHARGING = 0x0a
696
- LED_MAX = 0x0f
697
- LED_CNT = (0x0f+1)
698
- REP_DELAY = 0x00
699
- REP_PERIOD = 0x01
700
- REP_MAX = 0x01
701
- REP_CNT = (0x01+1)
702
- SND_CLICK = 0x00
703
- SND_BELL = 0x01
704
- SND_TONE = 0x02
705
- SND_MAX = 0x07
706
- SND_CNT = (0x07+1)
707
- ID_BUS = 0
708
- ID_VENDOR = 1
709
- ID_PRODUCT = 2
710
- ID_VERSION = 3
711
- BUS_PCI = 0x01
712
- BUS_ISAPNP = 0x02
713
- BUS_USB = 0x03
714
- BUS_HIL = 0x04
715
- BUS_BLUETOOTH = 0x05
716
- BUS_VIRTUAL = 0x06
717
- BUS_ISA = 0x10
718
- BUS_I8042 = 0x11
719
- BUS_XTKBD = 0x12
720
- BUS_RS232 = 0x13
721
- BUS_GAMEPORT = 0x14
722
- BUS_PARPORT = 0x15
723
- BUS_AMIGA = 0x16
724
- BUS_ADB = 0x17
725
- BUS_I2C = 0x18
726
- BUS_HOST = 0x19
727
- BUS_GSC = 0x1A
728
- BUS_ATARI = 0x1B
729
- BUS_SPI = 0x1C
730
- MT_TOOL_FINGER = 0
731
- MT_TOOL_PEN = 1
732
- MT_TOOL_MAX = 1
733
- FF_STATUS_STOPPED = 0x00
734
- FF_STATUS_PLAYING = 0x01
735
- FF_STATUS_MAX = 0x01
736
- class FfReplay < FFI::Struct
737
- layout(
738
- :length, :ushort,
739
- :delay, :ushort
740
- )
741
- end
742
- class FfTrigger < FFI::Struct
743
- layout(
744
- :button, :ushort,
745
- :interval, :ushort
746
- )
747
- end
748
- class FfEnvelope < FFI::Struct
749
- layout(
750
- :attack_length, :ushort,
751
- :attack_level, :ushort,
752
- :fade_length, :ushort,
753
- :fade_level, :ushort
754
- )
755
- end
756
- class FfConstantEffect < FFI::Struct
757
- layout(
758
- :level, :short,
759
- :envelope, FfEnvelope
760
- )
761
- end
762
- class FfRampEffect < FFI::Struct
763
- layout(
764
- :start_level, :short,
765
- :end_level, :short,
766
- :envelope, FfEnvelope
767
- )
768
- end
769
- class FfConditionEffect < FFI::Struct
770
- layout(
771
- :right_saturation, :ushort,
772
- :left_saturation, :ushort,
773
- :right_coeff, :short,
774
- :left_coeff, :short,
775
- :deadband, :ushort,
776
- :center, :short
777
- )
778
- end
779
- class FfPeriodicEffect < FFI::Struct
780
- layout(
781
- :waveform, :ushort,
782
- :period, :ushort,
783
- :magnitude, :short,
784
- :offset, :short,
785
- :phase, :ushort,
786
- :envelope, FfEnvelope,
787
- :custom_len, :uint,
788
- :custom_data, :pointer
789
- )
790
- end
791
- class FfRumbleEffect < FFI::Struct
792
- layout(
793
- :strong_magnitude, :ushort,
794
- :weak_magnitude, :ushort
795
- )
796
- end
797
- class FfEffectU < FFI::Union
798
- layout(
799
- :constant, FfConstantEffect,
800
- :ramp, FfRampEffect,
801
- :periodic, FfPeriodicEffect,
802
- :condition, [FfConditionEffect, 2],
803
- :rumble, FfRumbleEffect
804
- )
805
- end
806
- class FfEffect < FFI::Struct
807
- layout(
808
- :type, :ushort,
809
- :id, :short,
810
- :direction, :ushort,
811
- :trigger, FfTrigger,
812
- :replay, FfReplay,
813
- :u, FfEffectU
814
- )
815
- end
816
- FF_RUMBLE = 0x50
817
- FF_PERIODIC = 0x51
818
- FF_CONSTANT = 0x52
819
- FF_SPRING = 0x53
820
- FF_FRICTION = 0x54
821
- FF_DAMPER = 0x55
822
- FF_INERTIA = 0x56
823
- FF_RAMP = 0x57
824
- FF_EFFECT_MIN = 0x50
825
- FF_EFFECT_MAX = 0x57
826
- FF_SQUARE = 0x58
827
- FF_TRIANGLE = 0x59
828
- FF_SINE = 0x5a
829
- FF_SAW_UP = 0x5b
830
- FF_SAW_DOWN = 0x5c
831
- FF_CUSTOM = 0x5d
832
- FF_WAVEFORM_MIN = 0x58
833
- FF_WAVEFORM_MAX = 0x5d
834
- FF_GAIN = 0x60
835
- FF_AUTOCENTER = 0x61
836
- FF_MAX = 0x7f
837
- FF_CNT = (0x7f+1)
@@ -1,20 +0,0 @@
1
- IOC_NRBITS = 8
2
- IOC_TYPEBITS = 8
3
- IOC_SIZEBITS = 14
4
- IOC_DIRBITS = 2
5
- IOC_NRMASK = ((1 << 8) -1)
6
- IOC_TYPEMASK = ((1 << 8) -1)
7
- IOC_SIZEMASK = ((1 << 14) -1)
8
- IOC_DIRMASK = ((1 << 2) -1)
9
- IOC_NRSHIFT = 0
10
- IOC_TYPESHIFT = (0+8)
11
- IOC_SIZESHIFT = ((0+8) +8)
12
- IOC_DIRSHIFT = (((0+8) +8) +14)
13
- IOC_NONE = 0
14
- IOC_WRITE = 1
15
- IOC_READ = 2
16
- IOC_IN = (1 << (((0+8) +8) +14))
17
- IOC_OUT = (2 << (((0+8) +8) +14))
18
- IOC_INOUT = ((1|2) << (((0+8) +8) +14))
19
- IOCSIZE_MASK = (((1 << 14) -1) << ((0+8) +8))
20
- IOCSIZE_SHIFT = (((0+8) +8))
data/lib/uinput/input.rb DELETED
@@ -1,43 +0,0 @@
1
- class Timeval < FFI::Struct
2
- layout(
3
- :tv_sec, :__time_t,
4
- :tv_usec, :__suseconds_t
5
- )
6
- end
7
-
8
- module Uinput
9
- class_eval File.read(File.join(File.dirname(__FILE__), 'generated/input.rb'))
10
-
11
- INPUT_IOCTL_BASE = ?E.ord
12
-
13
- EVIOCGVERSION = Ioctl.IOR(INPUT_IOCTL_BASE, 0x01, :int)
14
- EVIOCGID = Ioctl.IOR(INPUT_IOCTL_BASE, 0x02, InputId.by_value)
15
- EVIOCGREP = Ioctl.IOR(INPUT_IOCTL_BASE, 0x03, :pointer)
16
- EVIOCSREP = Ioctl.IOW(INPUT_IOCTL_BASE, 0x03, :pointer)
17
- EVIOCGKEYCODE = Ioctl.IOR(INPUT_IOCTL_BASE, 0x04, :pointer)
18
- EVIOCGKEYCODE_V2 = Ioctl.IOR(INPUT_IOCTL_BASE, 0x04, InputKeymapEntry.by_value)
19
- EVIOCSKEYCODE = Ioctl.IOW(INPUT_IOCTL_BASE, 0x04, :pointer)
20
- EVIOCSKEYCODE_V2 = Ioctl.IOW(INPUT_IOCTL_BASE, 0x04, InputKeymapEntry.by_value)
21
-
22
- class << self
23
- def EVIOCGNAME(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x06, len) end
24
- def EVIOCGPHYS(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x07, len) end
25
- def EVIOCGUNIQ(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x08, len) end
26
- def EVIOCGPROP(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x09, len) end
27
- def EVIOCGMTSLOTS(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x0a, len) end
28
- def EVIOCGKEY(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x18, len) end
29
- def EVIOCGLED(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x19, len) end
30
- def EVIOCGSND(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x1a, len) end
31
- def EVIOCGSW(len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x1b, len) end
32
- def EVIOCGBIT(ev, len) Ioctl.IOC(Ioctl::IOC_READ, INPUT_IOCTL_BASE, 0x20 + ev, len) end
33
- def EVIOCGABS(abs) Ioctl.IOR(INPUT_IOCTL_BASE, 0x40 + abs, InputAbsinfo.by_value) end
34
- def EVIOCSABS(abs) Ioctl.IOW(INPUT_IOCTL_BASE, 0xc0 + abs, InputAbsinfo.by_value) end
35
- end
36
-
37
- EVIOCSFF = Ioctl.IOC(Ioctl::IOC_WRITE, INPUT_IOCTL_BASE, 0x80, FfEffect.size)
38
- EVIOCRMFF = Ioctl.IOW(INPUT_IOCTL_BASE, 0x81, :int)
39
- EVIOCGEFFECTS = Ioctl.IOR(INPUT_IOCTL_BASE, 0x84, :int)
40
- EVIOCGRAB = Ioctl.IOW(INPUT_IOCTL_BASE, 0x90, :int)
41
- EVIOCREVOKE = Ioctl.IOW(INPUT_IOCTL_BASE, 0x91, :int)
42
- EVIOCSCLOCKID = Ioctl.IOW(INPUT_IOCTL_BASE, 0xa0, :int)
43
- end
data/lib/uinput/ioctl.rb DELETED
@@ -1,25 +0,0 @@
1
- module Uinput
2
- module Ioctl
3
- class_eval File.read(File.join(File.dirname(__FILE__), 'generated/ioctl.rb'))
4
-
5
- class << self
6
- def IOC(dir, type, nr, size)
7
- (dir << IOC_DIRSHIFT) | (type << IOC_TYPESHIFT) | (nr << IOC_NRSHIFT) | (size << IOC_SIZESHIFT)
8
- end
9
-
10
- def IO(type, nr) IOC(IOC_NONE, type, nr, 0) end
11
- def IOR(type, nr, size) IOC(IOC_READ, type, nr, FFI.type_size(size)) end
12
- def IOW(type, nr, size) IOC(IOC_WRITE, type, nr, FFI.type_size(size)) end
13
- def IOWR(type, nr, size) IOC(IOC_READ | IOC_WRITE, type, nr, FFI.type_size(size)) end
14
- def IOR_BAD(type, nr, size) IOC(IOC_READ, type, nr, FFI.type_size(size)) end
15
- def IOW_BAD(type, nr, size) IOC(IOC_WRITE, type, nr, FFI.type_size(size)) end
16
- def IOWR_BAD(type, nr, size) IOC(IOC_READ | IOC_WRITE, type, nr, FFI.type_size(size)) end
17
-
18
- def IOC_DIR(nr) (nr >> IOC_DIRSHIFT) & IOC_DIRMASK end
19
- def IOC_TYPE(nr) (nr >> IOC_TYPESHIFT) & IOC_TYPEMASK end
20
- def IOC_NR(nr) (nr >> IOC_NRSHIFT) & IOC_NRMASK end
21
- def IOC_SIZE(nr) (nr >> IOC_SIZESHIFT) & IOC_SIZEMASK end
22
- end
23
- end
24
- end
25
-
data/swig/input.i DELETED
@@ -1,20 +0,0 @@
1
- %module input
2
-
3
- typedef char __s8;
4
- typedef unsigned char __u8;
5
-
6
- typedef short __s16;
7
- typedef unsigned short __u16;
8
-
9
- typedef int __s32;
10
- typedef unsigned int __u32;
11
-
12
- #ifdef __GNUC__
13
- __extension__ typedef long long __s64;
14
- __extension__ typedef unsigned long long __u64;
15
- #else
16
- typedef long long __s64;
17
- typedef unsigned long long __u64;
18
- #endif
19
-
20
- %include "linux/input.h"
data/swig/ioctl.i DELETED
@@ -1,2 +0,0 @@
1
- %module ioctl
2
- %include "asm-generic/ioctl.h"