linux_input 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 +5 -5
- data/.rakeTasks +7 -0
- data/README.md +3 -0
- data/lib/linux_input/generated/input.rb +93 -46
- data/lib/linux_input/version.rb +1 -1
- data/linux_input.gemspec +1 -1
- data/swig/input.i +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eb9a565c5471d459f9c34b7d2c9aedafbb77d6b9813328f993be2e4dadd59c9e
|
4
|
+
data.tar.gz: 171f30da9f919f0bf1739f3f4f8081f4e819ca668fec72bc1ecfe8bf6123eaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e95c844dd6bde0322d819eb4a46f38cfd5b197a7c49bc696e706a9f4aaab3bddd78367331c452bbdda819c9f20b2a1263772185374bdee8eb6b2b1bff9b2d698
|
7
|
+
data.tar.gz: b16c4d1f5623280c01207080194ba2ff164957aefbdb2f081eb9903c1d8e1cc199153bf1f14dbba51e57a9d4566fd79e4e96854c4f7ae6855e7e317bc2e03c07
|
data/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build linux_input-1.0.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeGroup description="" fullCmd="" taksId="ffi"><RakeTask description="Generate ffi interface" fullCmd="ffi:generate" taksId="generate" /></RakeGroup><RakeTask description="Build and install linux_input-1.0.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v1.0.0 and build and push linux_input-1.0.0.gem to Rubygems" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
FFI structs and constants for linux's input subsystem found in linux/input.h
|
4
4
|
|
5
|
+
Have a look at the [Libevdev](https://github.com/christopheraue/ruby-libevdev)
|
6
|
+
gem for an easier to use interface to the input subsystem.
|
7
|
+
|
5
8
|
## Installation
|
6
9
|
|
7
10
|
Add this line to your application's Gemfile:
|
@@ -1,40 +1,3 @@
|
|
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
1
|
INPUT_PROP_POINTER = 0x00
|
39
2
|
INPUT_PROP_DIRECT = 0x01
|
40
3
|
INPUT_PROP_BUTTONPAD = 0x02
|
@@ -218,6 +181,7 @@
|
|
218
181
|
KEY_MSDOS = 151
|
219
182
|
KEY_COFFEE = 152
|
220
183
|
KEY_SCREENLOCK = 152
|
184
|
+
KEY_ROTATE_DISPLAY = 153
|
221
185
|
KEY_DIRECTION = 153
|
222
186
|
KEY_CYCLEWINDOWS = 154
|
223
187
|
KEY_MAIL = 155
|
@@ -375,6 +339,7 @@
|
|
375
339
|
BTN_TOOL_MOUSE = 0x146
|
376
340
|
BTN_TOOL_LENS = 0x147
|
377
341
|
BTN_TOOL_QUINTTAP = 0x148
|
342
|
+
BTN_STYLUS3 = 0x149
|
378
343
|
BTN_TOUCH = 0x14a
|
379
344
|
BTN_STYLUS = 0x14b
|
380
345
|
BTN_STYLUS2 = 0x14c
|
@@ -404,9 +369,11 @@
|
|
404
369
|
KEY_TITLE = 0x171
|
405
370
|
KEY_SUBTITLE = 0x172
|
406
371
|
KEY_ANGLE = 0x173
|
372
|
+
KEY_FULL_SCREEN = 0x174
|
407
373
|
KEY_ZOOM = 0x174
|
408
374
|
KEY_MODE = 0x175
|
409
375
|
KEY_KEYBOARD = 0x176
|
376
|
+
KEY_ASPECT_RATIO = 0x177
|
410
377
|
KEY_SCREEN = 0x177
|
411
378
|
KEY_PC = 0x178
|
412
379
|
KEY_TV = 0x179
|
@@ -523,6 +490,10 @@
|
|
523
490
|
KEY_NUMERIC_9 = 0x209
|
524
491
|
KEY_NUMERIC_STAR = 0x20a
|
525
492
|
KEY_NUMERIC_POUND = 0x20b
|
493
|
+
KEY_NUMERIC_A = 0x20c
|
494
|
+
KEY_NUMERIC_B = 0x20d
|
495
|
+
KEY_NUMERIC_C = 0x20e
|
496
|
+
KEY_NUMERIC_D = 0x20f
|
526
497
|
KEY_CAMERA_FOCUS = 0x210
|
527
498
|
KEY_WPS_BUTTON = 0x211
|
528
499
|
KEY_TOUCHPAD_TOGGLE = 0x212
|
@@ -543,6 +514,7 @@
|
|
543
514
|
BTN_DPAD_LEFT = 0x222
|
544
515
|
BTN_DPAD_RIGHT = 0x223
|
545
516
|
KEY_ALS_TOGGLE = 0x230
|
517
|
+
KEY_ROTATE_LOCK_TOGGLE = 0x231
|
546
518
|
KEY_BUTTONCONFIG = 0x240
|
547
519
|
KEY_TASKMANAGER = 0x241
|
548
520
|
KEY_JOURNAL = 0x242
|
@@ -550,6 +522,8 @@
|
|
550
522
|
KEY_APPSELECT = 0x244
|
551
523
|
KEY_SCREENSAVER = 0x245
|
552
524
|
KEY_VOICECOMMAND = 0x246
|
525
|
+
KEY_ASSISTANT = 0x247
|
526
|
+
KEY_KBD_LAYOUT_NEXT = 0x248
|
553
527
|
KEY_BRIGHTNESS_MIN = 0x250
|
554
528
|
KEY_BRIGHTNESS_MAX = 0x251
|
555
529
|
KEY_KBDINPUTASSIST_PREV = 0x260
|
@@ -558,6 +532,25 @@
|
|
558
532
|
KEY_KBDINPUTASSIST_NEXTGROUP = 0x263
|
559
533
|
KEY_KBDINPUTASSIST_ACCEPT = 0x264
|
560
534
|
KEY_KBDINPUTASSIST_CANCEL = 0x265
|
535
|
+
KEY_RIGHT_UP = 0x266
|
536
|
+
KEY_RIGHT_DOWN = 0x267
|
537
|
+
KEY_LEFT_UP = 0x268
|
538
|
+
KEY_LEFT_DOWN = 0x269
|
539
|
+
KEY_ROOT_MENU = 0x26a
|
540
|
+
KEY_MEDIA_TOP_MENU = 0x26b
|
541
|
+
KEY_NUMERIC_11 = 0x26c
|
542
|
+
KEY_NUMERIC_12 = 0x26d
|
543
|
+
KEY_AUDIO_DESC = 0x26e
|
544
|
+
KEY_3D_MODE = 0x26f
|
545
|
+
KEY_NEXT_FAVORITE = 0x270
|
546
|
+
KEY_STOP_RECORD = 0x271
|
547
|
+
KEY_PAUSE_RECORD = 0x272
|
548
|
+
KEY_VOD = 0x273
|
549
|
+
KEY_UNMUTE = 0x274
|
550
|
+
KEY_FASTREVERSE = 0x275
|
551
|
+
KEY_SLOWREVERSE = 0x276
|
552
|
+
KEY_DATA = 0x277
|
553
|
+
KEY_ONSCREEN_KEYBOARD = 0x278
|
561
554
|
BTN_TRIGGER_HAPPY = 0x2c0
|
562
555
|
BTN_TRIGGER_HAPPY1 = 0x2c0
|
563
556
|
BTN_TRIGGER_HAPPY2 = 0x2c1
|
@@ -612,6 +605,9 @@
|
|
612
605
|
REL_DIAL = 0x07
|
613
606
|
REL_WHEEL = 0x08
|
614
607
|
REL_MISC = 0x09
|
608
|
+
REL_RESERVED = 0x0a
|
609
|
+
REL_WHEEL_HI_RES = 0x0b
|
610
|
+
REL_HWHEEL_HI_RES = 0x0c
|
615
611
|
REL_MAX = 0x0f
|
616
612
|
REL_CNT = (0x0f+1)
|
617
613
|
ABS_X = 0x00
|
@@ -640,6 +636,7 @@
|
|
640
636
|
ABS_TOOL_WIDTH = 0x1c
|
641
637
|
ABS_VOLUME = 0x20
|
642
638
|
ABS_MISC = 0x28
|
639
|
+
ABS_RESERVED = 0x2e
|
643
640
|
ABS_MT_SLOT = 0x2f
|
644
641
|
ABS_MT_TOUCH_MAJOR = 0x30
|
645
642
|
ABS_MT_TOUCH_MINOR = 0x31
|
@@ -673,6 +670,7 @@
|
|
673
670
|
SW_ROTATE_LOCK = 0x0c
|
674
671
|
SW_LINEIN_INSERT = 0x0d
|
675
672
|
SW_MUTE_DEVICE = 0x0e
|
673
|
+
SW_PEN_INSERTED = 0x0f
|
676
674
|
SW_MAX = 0x0f
|
677
675
|
SW_CNT = (0x0f+1)
|
678
676
|
MSC_SERIAL = 0x00
|
@@ -705,6 +703,50 @@
|
|
705
703
|
SND_TONE = 0x02
|
706
704
|
SND_MAX = 0x07
|
707
705
|
SND_CNT = (0x07+1)
|
706
|
+
class InputEvent < FFI::Struct
|
707
|
+
layout(
|
708
|
+
:time, Timeval,
|
709
|
+
:type, :ushort,
|
710
|
+
:code, :ushort,
|
711
|
+
:value, :int
|
712
|
+
)
|
713
|
+
end
|
714
|
+
EV_VERSION = 0x010001
|
715
|
+
class InputId < FFI::Struct
|
716
|
+
layout(
|
717
|
+
:bustype, :ushort,
|
718
|
+
:vendor, :ushort,
|
719
|
+
:product, :ushort,
|
720
|
+
:version, :ushort
|
721
|
+
)
|
722
|
+
end
|
723
|
+
class InputAbsinfo < FFI::Struct
|
724
|
+
layout(
|
725
|
+
:value, :int,
|
726
|
+
:minimum, :int,
|
727
|
+
:maximum, :int,
|
728
|
+
:fuzz, :int,
|
729
|
+
:flat, :int,
|
730
|
+
:resolution, :int
|
731
|
+
)
|
732
|
+
end
|
733
|
+
INPUT_KEYMAP_BY_INDEX = (1 << 0)
|
734
|
+
class InputKeymapEntry < FFI::Struct
|
735
|
+
layout(
|
736
|
+
:flags, :uchar,
|
737
|
+
:len, :uchar,
|
738
|
+
:index, :ushort,
|
739
|
+
:keycode, :uint,
|
740
|
+
:scancode, [:uchar, 32]
|
741
|
+
)
|
742
|
+
end
|
743
|
+
class InputMask < FFI::Struct
|
744
|
+
layout(
|
745
|
+
:type, :uint,
|
746
|
+
:codes_size, :uint,
|
747
|
+
:codes_ptr, :ulong_long
|
748
|
+
)
|
749
|
+
end
|
708
750
|
ID_BUS = 0
|
709
751
|
ID_VENDOR = 1
|
710
752
|
ID_PRODUCT = 2
|
@@ -728,10 +770,14 @@
|
|
728
770
|
BUS_GSC = 0x1A
|
729
771
|
BUS_ATARI = 0x1B
|
730
772
|
BUS_SPI = 0x1C
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
773
|
+
BUS_RMI = 0x1D
|
774
|
+
BUS_CEC = 0x1E
|
775
|
+
BUS_INTEL_ISHTP = 0x1F
|
776
|
+
MT_TOOL_FINGER = 0x00
|
777
|
+
MT_TOOL_PEN = 0x01
|
778
|
+
MT_TOOL_PALM = 0x02
|
779
|
+
MT_TOOL_DIAL = 0x0a
|
780
|
+
MT_TOOL_MAX = 0x0f
|
735
781
|
FF_STATUS_STOPPED = 0x00
|
736
782
|
FF_STATUS_PLAYING = 0x01
|
737
783
|
FF_STATUS_MAX = 0x01
|
@@ -798,11 +844,11 @@
|
|
798
844
|
end
|
799
845
|
class FfEffectU < FFI::Union
|
800
846
|
layout(
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
847
|
+
:constant, FfConstantEffect,
|
848
|
+
:ramp, FfRampEffect,
|
849
|
+
:periodic, FfPeriodicEffect,
|
850
|
+
:condition, [FfConditionEffect, 2],
|
851
|
+
:rumble, FfRumbleEffect
|
806
852
|
)
|
807
853
|
end
|
808
854
|
class FfEffect < FFI::Struct
|
@@ -835,5 +881,6 @@
|
|
835
881
|
FF_WAVEFORM_MAX = 0x5d
|
836
882
|
FF_GAIN = 0x60
|
837
883
|
FF_AUTOCENTER = 0x61
|
884
|
+
FF_MAX_EFFECTS = 0x60
|
838
885
|
FF_MAX = 0x7f
|
839
886
|
FF_CNT = (0x7f+1)
|
data/lib/linux_input/version.rb
CHANGED
data/linux_input.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
|
20
20
|
spec.add_runtime_dependency 'ffi', '~> 1.9'
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.8"
|
22
|
-
spec.add_development_dependency "rake", "~>
|
22
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
23
23
|
spec.add_development_dependency "ffi-swig-generator", '~> 0'
|
24
24
|
end
|
data/swig/input.i
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_input
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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:
|
11
|
+
date: 2020-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: ffi-swig-generator
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
+
- ".rakeTasks"
|
77
78
|
- ".rspec"
|
78
79
|
- ".travis.yml"
|
79
80
|
- Gemfile
|
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
111
|
version: '0'
|
111
112
|
requirements: []
|
112
113
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.7.6
|
114
115
|
signing_key:
|
115
116
|
specification_version: 4
|
116
117
|
summary: FFI structs and constants for linux's input subsystem
|