uinput 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uinput.rb +27 -3
- data/lib/uinput/generated/uinput.rb +15 -2
- data/lib/uinput/uinput.rb +4 -2
- data/lib/uinput/version.rb +1 -1
- data/swig/uinput.i +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f0b349b76ac4f0a251bc6bef1f34c396cc40c7
|
4
|
+
data.tar.gz: 202b101983e29f6bba93b2bef4fc7517f584f98a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da025070a6a5daa8791781eca36c6e2fca30d606e3ed856497fec45b6127ed4b9511cc1defe0e605d6b29ad013784ded0a87115d83f21b75ca6beed359f414b1
|
7
|
+
data.tar.gz: a96b43bd9e0946bf7e0eac4f2689dd05ae10776ae6ce59c8ce77bfc0b21e888072f5a3d926769163deb02ef347016eaf11fdcd7596781104a656f04389893b71
|
data/lib/uinput.rb
CHANGED
@@ -1,6 +1,30 @@
|
|
1
|
-
require '
|
1
|
+
require 'fcntl'
|
2
2
|
require 'linux_input'
|
3
|
-
|
4
|
-
|
3
|
+
|
4
|
+
require_relative "uinput/version"
|
5
|
+
require_relative 'uinput/uinput.rb'
|
5
6
|
|
6
7
|
Uinput = LinuxInput::Uinput
|
8
|
+
|
9
|
+
module Uinput
|
10
|
+
FILE_PATH = '/dev/uinput'
|
11
|
+
|
12
|
+
def self.open_file(mode = Fcntl::O_RDWR)
|
13
|
+
File.open(FILE_PATH, mode)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.version
|
17
|
+
@version ||= begin
|
18
|
+
pack_size = case FFI.type_size(:uint)
|
19
|
+
when 2 then 's'
|
20
|
+
when 4 then 'L'
|
21
|
+
when 8 then 'Q'
|
22
|
+
end
|
23
|
+
|
24
|
+
version = [0].pack pack_size
|
25
|
+
open_file.ioctl UI_GET_VERSION, version
|
26
|
+
version.unpack(pack_size).first
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
@@ -1,4 +1,5 @@
|
|
1
|
-
UINPUT_VERSION =
|
1
|
+
#generated from UINPUT_VERSION = 5
|
2
|
+
UINPUT_MAX_NAME_SIZE = 80
|
2
3
|
class UinputFfUpload < FFI::Struct
|
3
4
|
layout(
|
4
5
|
:request_id, :uint,
|
@@ -15,10 +16,22 @@
|
|
15
16
|
)
|
16
17
|
end
|
17
18
|
UINPUT_IOCTL_BASE = ?U.ord
|
19
|
+
class UinputSetup < FFI::Struct
|
20
|
+
layout(
|
21
|
+
:id, InputId,
|
22
|
+
:name, [:char, 80],
|
23
|
+
:ff_effects_max, :uint
|
24
|
+
)
|
25
|
+
end
|
26
|
+
class UinputAbsSetup < FFI::Struct
|
27
|
+
layout(
|
28
|
+
:code, :ushort,
|
29
|
+
:absinfo, InputAbsinfo
|
30
|
+
)
|
31
|
+
end
|
18
32
|
EV_UINPUT = 0x0101
|
19
33
|
UI_FF_UPLOAD = 1
|
20
34
|
UI_FF_ERASE = 2
|
21
|
-
UINPUT_MAX_NAME_SIZE = 80
|
22
35
|
class UinputUserDev < FFI::Struct
|
23
36
|
layout(
|
24
37
|
:name, [:char, 80],
|
data/lib/uinput/uinput.rb
CHANGED
@@ -4,6 +4,8 @@ module LinuxInput
|
|
4
4
|
|
5
5
|
UI_DEV_CREATE = Ioctl.IO(UINPUT_IOCTL_BASE, 1)
|
6
6
|
UI_DEV_DESTROY = Ioctl.IO(UINPUT_IOCTL_BASE, 2)
|
7
|
+
UI_DEV_SETUP = Ioctl.IOW(UINPUT_IOCTL_BASE, 3, UinputSetup.by_value)
|
8
|
+
UI_ABS_SETUP = Ioctl.IOW(UINPUT_IOCTL_BASE, 4, UinputAbsSetup.by_value)
|
7
9
|
|
8
10
|
UI_SET_EVBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 100, :int)
|
9
11
|
UI_SET_KEYBIT = Ioctl.IOW(UINPUT_IOCTL_BASE, 101, :int)
|
@@ -22,7 +24,7 @@ module LinuxInput
|
|
22
24
|
UI_BEGIN_FF_ERASE = Ioctl.IOWR(UINPUT_IOCTL_BASE, 202, UinputFfErase.by_value)
|
23
25
|
UI_END_FF_ERASE = Ioctl.IOW(UINPUT_IOCTL_BASE, 203, UinputFfErase.by_value)
|
24
26
|
|
25
|
-
def self.UI_GET_SYSNAME(len) Ioctl.IOC(Ioctl::IOC_READ, UINPUT_IOCTL_BASE,
|
26
|
-
UI_GET_VERSION = Ioctl.IOR(UINPUT_IOCTL_BASE,
|
27
|
+
def self.UI_GET_SYSNAME(len) Ioctl.IOC(Ioctl::IOC_READ, UINPUT_IOCTL_BASE, 44, len) end
|
28
|
+
UI_GET_VERSION = Ioctl.IOR(UINPUT_IOCTL_BASE, 45, :uint)
|
27
29
|
end
|
28
30
|
end
|
data/lib/uinput/version.rb
CHANGED
data/swig/uinput.i
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uinput
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.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: 2017-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linux_input
|
@@ -106,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.5.1
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Structs and Constants to use uinput with ruby.
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|