Module: Vigilem::Evdev::System::Input::Macros

Included in:
Vigilem::Evdev::System::Input, Vigilem::Evdev::System::Input
Defined in:
lib/vigilem/evdev/system/input.rb

Overview

these will be phased out and replaced by FFI

Instance Method Summary collapse

Instance Method Details

#_s16Object



92
93
94
# File 'lib/vigilem/evdev/system/input.rb', line 92

def _s16
  @_s16 ||= 's'
end

#_u16Object



84
85
86
# File 'lib/vigilem/evdev/system/input.rb', line 84

def _u16 
  @_u16= 'S'
end

#_u32Object



88
89
90
# File 'lib/vigilem/evdev/system/input.rb', line 88

def _u32
  @_u32 ||= 'L'
end

#_u8Object



80
81
82
# File 'lib/vigilem/evdev/system/input.rb', line 80

def _u8 
  @_u8 = 'C'
end

#EVIOCGABS(abs) ⇒ Object

/* get abs value/limits */



135
# File 'lib/vigilem/evdev/system/input.rb', line 135

def EVIOCGABS(abs);          _IOR('E', 0x40 + abs, INT5);end

#EVIOCGBIT(evtype, len = 255) ⇒ Object

/* get event bits */



134
# File 'lib/vigilem/evdev/system/input.rb', line 134

def EVIOCGBIT(evtype, len=255); _IOC(_IOC_READ, 'E', 0x20 + evtype, len);end

#EVIOCGEFFECTSObject

/* Report number of effects playable at the same time */



141
# File 'lib/vigilem/evdev/system/input.rb', line 141

def EVIOCGEFFECTS;          _IOR('E', 0x84, int);end

#EVIOCGIDObject

/* get device ID */



113
# File 'lib/vigilem/evdev/system/input.rb', line 113

def EVIOCGID;                _IOR('E', 0x02, struct_input_id);end

#EVIOCGKEY(len) ⇒ Object

/* get global key state */



129
# File 'lib/vigilem/evdev/system/input.rb', line 129

def EVIOCGKEY(len);          _IOC(_IOC_READ, 'E', 0x18, len);end

#EVIOCGKEYCODEObject

/* get keycode */



117
# File 'lib/vigilem/evdev/system/input.rb', line 117

def EVIOCGKEYCODE;            _IOR('E', 0x04, unsigned_int_2);end

#EVIOCGKEYCODE_V2Object



118
# File 'lib/vigilem/evdev/system/input.rb', line 118

def EVIOCGKEYCODE_V2;         _IOR('E', 0x04, input_keymap_entry);end

#EVIOCGLED(len) ⇒ Object

/* get all LEDs */



130
# File 'lib/vigilem/evdev/system/input.rb', line 130

def EVIOCGLED(len);          _IOC(_IOC_READ, 'E', 0x19, len);end

#EVIOCGMTSLOTS(len) ⇒ Object



127
# File 'lib/vigilem/evdev/system/input.rb', line 127

def EVIOCGMTSLOTS(len);      _IOC(_IOC_READ, 'E', 0x0a, len);end

#EVIOCGNAME(len) ⇒ Object

/* get device name */



122
# File 'lib/vigilem/evdev/system/input.rb', line 122

def EVIOCGNAME(len);         _IOC(_IOC_READ, 'E', 0x06, len);end

#EVIOCGPHYS(len) ⇒ Object

/* get physical location */



123
# File 'lib/vigilem/evdev/system/input.rb', line 123

def EVIOCGPHYS(len);         _IOC(_IOC_READ, 'E', 0x07, len);end

#EVIOCGPROP(len) ⇒ Object

/* get device properties */



125
# File 'lib/vigilem/evdev/system/input.rb', line 125

def EVIOCGPROP(len);         _IOC(_IOC_READ, 'E', 0x09, len);end

#EVIOCGRABObject

/* Grab/Release device */



143
# File 'lib/vigilem/evdev/system/input.rb', line 143

def EVIOCGRAB;              _IOW('E', 0x90, int);end

#EVIOCGREPObject

/* get repeat settings */



114
# File 'lib/vigilem/evdev/system/input.rb', line 114

def EVIOCGREP;               _IOR('E', 0x03, unsigned_int_2);end

#EVIOCGSND(len) ⇒ Object

/* get all sounds status */



131
# File 'lib/vigilem/evdev/system/input.rb', line 131

def EVIOCGSND(len);          _IOC(_IOC_READ, 'E', 0x1a, len);end

#EVIOCGSW(len) ⇒ Object

/* get all switch states */



133
# File 'lib/vigilem/evdev/system/input.rb', line 133

def EVIOCGSW(len);           _IOC(_IOC_READ, 'E', 0x1b, len);end

#EVIOCGUNIQ(len) ⇒ Object

/* get unique identifier */



124
# File 'lib/vigilem/evdev/system/input.rb', line 124

def EVIOCGUNIQ(len);         _IOC(_IOC_READ, 'E', 0x08, len);end

#EVIOCGVERSIONObject

/* get driver version */



112
# File 'lib/vigilem/evdev/system/input.rb', line 112

def EVIOCGVERSION;           _IOR('E', 0x01, int);end

#EVIOCREVOKEObject

/* Revoke device access */



144
# File 'lib/vigilem/evdev/system/input.rb', line 144

def EVIOCREVOKE;            _IOW('E', 0x91, int);end

#EVIOCRMFFObject

/* Erase a force effect */



140
# File 'lib/vigilem/evdev/system/input.rb', line 140

def EVIOCRMFF;              _IOW('E', 0x81, int);end

#EVIOCSABS(abs) ⇒ Object

/* set abs value/limits */



137
# File 'lib/vigilem/evdev/system/input.rb', line 137

def EVIOCSABS(abs);          _IOW('E', 0xc0 + (abs), input_absinfo);end

#EVIOCSCLOCKIDObject

/* Set clockid to be used for timestamps */



146
# File 'lib/vigilem/evdev/system/input.rb', line 146

def EVIOCSCLOCKID;          _IOW('E', 0xa0, int);end

#EVIOCSFFObject

/* send a force effect to a force feedback device */



139
# File 'lib/vigilem/evdev/system/input.rb', line 139

def EVIOCSFF;               _IOC(_IOC_WRITE, 'E', 0x80, _size_of(ff_effect));end

#EVIOCSKEYCODEObject

/* set keycode */



119
# File 'lib/vigilem/evdev/system/input.rb', line 119

def EVIOCSKEYCODE;            _IOW('E', 0x04, unsigned_int_2);end

#EVIOCSKEYCODE_V2Object



120
# File 'lib/vigilem/evdev/system/input.rb', line 120

def EVIOCSKEYCODE_V2;         _IOW('E', 0x04, input_keymap_entry);end

#EVIOCSREPObject

/* set repeat settings */



115
# File 'lib/vigilem/evdev/system/input.rb', line 115

def EVIOCSREP;               _IOW('E', 0x03, unsigned_int_2);end

#ff_effectObject



76
77
78
# File 'lib/vigilem/evdev/system/input.rb', line 76

def ff_effect
  FFEffect
end

#input_keymap_entryObject



100
101
102
# File 'lib/vigilem/evdev/system/input.rb', line 100

def input_keymap_entry 
  @input_keymap_entry ||= _u8 + _u8 + _u16 + _u32 + (_u8 * 32)
end

#intObject



108
109
110
# File 'lib/vigilem/evdev/system/input.rb', line 108

def int
  @int ||= 'i'
end

#struct_input_idObject



96
97
98
# File 'lib/vigilem/evdev/system/input.rb', line 96

def struct_input_id
  @struct_input_id ||= _u16 + '4'
end

#unsigned_int_2Object



104
105
106
# File 'lib/vigilem/evdev/system/input.rb', line 104

def unsigned_int_2 
  @unsigned_int_2 ||= 'ii'
end