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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 138b284e323a5e521fcc923aa94058bfdb6ce3b4
4
- data.tar.gz: 4fe3b8f8856804cd93945588b7b39e09917ddb66
3
+ metadata.gz: a8f0b349b76ac4f0a251bc6bef1f34c396cc40c7
4
+ data.tar.gz: 202b101983e29f6bba93b2bef4fc7517f584f98a
5
5
  SHA512:
6
- metadata.gz: dd72c33903fb705e22e4df692278d53a4f9864763c7a7c9a02d182890b6fbf2207d9ff4bab18d9129479779439f956abd0c1a706ed691292ec7eec2d3cb81ca9
7
- data.tar.gz: c019ddd71246abbf28997222e1c22d65a6c152873f84626a57a73f18e2319eeeacffe3c70a4b743fb47fc5db0d839928763e737e4df34bcba96103bc9cde7184
6
+ metadata.gz: da025070a6a5daa8791781eca36c6e2fca30d606e3ed856497fec45b6127ed4b9511cc1defe0e605d6b29ad013784ded0a87115d83f21b75ca6beed359f414b1
7
+ data.tar.gz: a96b43bd9e0946bf7e0eac4f2689dd05ae10776ae6ce59c8ce77bfc0b21e888072f5a3d926769163deb02ef347016eaf11fdcd7596781104a656f04389893b71
@@ -1,6 +1,30 @@
1
- require 'bundler/setup'
1
+ require 'fcntl'
2
2
  require 'linux_input'
3
- require "uinput/version"
4
- require 'uinput/uinput.rb'
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 = 4
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],
@@ -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, 300, len) end
26
- UI_GET_VERSION = Ioctl.IOR(UINPUT_IOCTL_BASE, 301, :uint)
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
@@ -1,5 +1,5 @@
1
1
  module LinuxInput
2
2
  module Uinput
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -17,4 +17,6 @@ typedef long long __s64;
17
17
  typedef unsigned long long __u64;
18
18
  #endif
19
19
 
20
+ %rename("#generated from UINPUT_VERSION") UINPUT_VERSION;
21
+
20
22
  %include "linux/uinput.h"
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.1.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: 2015-08-28 00:00:00.000000000 Z
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.4.8
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: