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

- (Key) initialize(keyval)

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

- (Object) code (readonly)

Returns the value of attribute code



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

def code
  @code
end

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

Instance Method Details

- (Object) ==(key)



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

- (Object) inspect

def ==



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

def inspect; @name end