Class: Gdk::Key

Inherits:
Object show all
Defined in:
lib/tagen/gtk2.rb

Overview

class EventKey

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keyval) ⇒ Key

Returns a new instance of Key.



104
105
106
107
# File 'lib/tagen/gtk2.rb', line 104

def initialize keyval
	@code = keyval
	@name = Keyval.to_name(keyval).downcase.to_sym
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



103
104
105
# File 'lib/tagen/gtk2.rb', line 103

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name.



103
104
105
# File 'lib/tagen/gtk2.rb', line 103

def name
  @name
end

Instance Method Details

#==(key) ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/tagen/gtk2.rb', line 109

def ==(key)
	case key
	when Integer
		@code == key
	when String,Symbol
		@name == key.to_sym
	end
end

#inspectObject

def ==



118
# File 'lib/tagen/gtk2.rb', line 118

def inspect; @name end