Class: Vigilem::Win32API::INPUT_RECORD

Inherits:
VFFIStruct
  • Object
show all
Defined in:
lib/vigilem/win32_api/input__record.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.event_record(input_record) ⇒ INPUT_RECORD::Union::*_EVENT_RECORD

Parameters:

  • input_record (EventUnion?)

Returns:

  • (INPUT_RECORD::Union::*_EVENT_RECORD)


39
40
41
42
# File 'lib/vigilem/win32_api/input__record.rb', line 39

def self.event_record(input_record)
  sym = ConsoleInputEvents.vk_hash[input_record.EventType].to_s.downcase.titlecase.gsub(/\s+/, '').to_sym
  input_record.Event[sym] unless sym.nil? or sym.empty?
end

Instance Method Details

#event_recordINPUT_RECORD::Union::*_EVENT_RECORD

Returns:

  • (INPUT_RECORD::Union::*_EVENT_RECORD)


32
33
34
# File 'lib/vigilem/win32_api/input__record.rb', line 32

def event_record
  self.class.event_record(self)
end

#inspectString

Returns:

  • (String)


46
47
48
49
# File 'lib/vigilem/win32_api/input__record.rb', line 46

def inspect
  head, tail = super.split(' ', 2)
  "#{head} event_record=#{event_record.inspect} #{tail}"
end

#to_hHash

Returns:

  • (Hash)


20
21
22
# File 'lib/vigilem/win32_api/input__record.rb', line 20

def to_h
  FFIUtils.struct_to_h(self)
end

#typeInteger

Returns:

  • (Integer)


26
27
28
# File 'lib/vigilem/win32_api/input__record.rb', line 26

def type
  self.EventType
end