Class: Xkbcommon::Modifier

Inherits:
Object
  • Object
show all
Defined in:
lib/xkbcommon/modifier.rb

Constant Summary collapse

SYMBOLS =
[
  :Shift_L,
  :Shift_R,
  :Control_L,
  :Control_R,
  #:Caps_Lock,
  #:Shift_Lock,
  :Meta_L,
  :Meta_R,
  :Alt_L,
  :Alt_R,
  :Super_L,
  :Super_R,
  :Hyper_L,
  :Hyper_R,
  #:ISO_Lock,
  :ISO_Level2_Latch,
  :ISO_Level3_Shift,
  :ISO_Level3_Latch,
  #:ISO_Level3_Lock,
  :ISO_Level5_Shift,
  :ISO_Level5_Latch,
  #:ISO_Level5_Lock,
  :ISO_Group_Shift,
  :ISO_Group_Latch,
  #:ISO_Group_Lock,
  :ISO_Next_Group,
  #:ISO_Next_Group_Lock,
  :ISO_Prev_Group,
  #:ISO_Prev_Group_Lock,
  :ISO_First_Group,
  #:ISO_First_Group_Lock,
  :ISO_Last_Group#,
  #:ISO_Last_Group_Lock
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keymap, index) ⇒ Modifier

Returns a new instance of Modifier.



39
40
41
42
# File 'lib/xkbcommon/modifier.rb', line 39

def initialize(keymap, index)
  @keymap, @index = keymap, index
  @name = Libxkbcommon.xkb_keymap_mod_get_name(keymap.to_native, index).to_sym
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



44
45
46
# File 'lib/xkbcommon/modifier.rb', line 44

def index
  @index
end

#keymapObject (readonly)

Returns the value of attribute keymap.



44
45
46
# File 'lib/xkbcommon/modifier.rb', line 44

def keymap
  @keymap
end

#keysObject

Returns the value of attribute keys.



44
45
46
# File 'lib/xkbcommon/modifier.rb', line 44

def keys
  @keys
end

#nameObject (readonly)

Returns the value of attribute name.



44
45
46
# File 'lib/xkbcommon/modifier.rb', line 44

def name
  @name
end

Instance Method Details

#inspectObject



51
52
53
# File 'lib/xkbcommon/modifier.rb', line 51

def inspect
  "#<#{self.class.name}:0x#{'%014x' % __id__} @name=#{name.inspect} @keys=#{keys.map(&:code).inspect}>"
end