gamebox 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +14 -0
- data/Manifest.txt +40 -37
- data/README.txt +2 -2
- data/Rakefile +27 -20
- data/TODO.txt +8 -8
- data/bin/gamebox +7 -1
- data/docs/getting_started.rdoc +2 -5
- data/docs/logo.png +0 -0
- data/lib/gamebox.rb +12 -1
- data/lib/gamebox/actor.rb +34 -9
- data/lib/gamebox/actor_factory.rb +25 -14
- data/lib/gamebox/actor_view.rb +6 -6
- data/lib/gamebox/{logo.rb → actors/logo.rb} +0 -0
- data/lib/gamebox/{score.rb → actors/score.rb} +2 -1
- data/lib/gamebox/{svg_actor.rb → actors/svg_actor.rb} +3 -4
- data/lib/gamebox/ai/polaris.rb +2 -0
- data/lib/gamebox/behavior.rb +3 -0
- data/lib/gamebox/{animated.rb → behaviors/animated.rb} +13 -5
- data/lib/gamebox/{graphical.rb → behaviors/graphical.rb} +11 -1
- data/lib/gamebox/{layered.rb → behaviors/layered.rb} +14 -0
- data/lib/gamebox/{physical.rb → behaviors/physical.rb} +41 -14
- data/lib/gamebox/{updatable.rb → behaviors/updatable.rb} +1 -1
- data/lib/gamebox/{templates/template_app → data}/config/objects.yml +4 -2
- data/lib/gamebox/data/graphics/logo.png +0 -0
- data/lib/gamebox/event_compat.rb +285 -0
- data/lib/gamebox/ftor.rb +2 -0
- data/lib/gamebox/gamebox_application.rb +12 -1
- data/lib/gamebox/generators/actor_generator.rb +2 -2
- data/lib/gamebox/generators/view_generator.rb +42 -0
- data/lib/gamebox/input_manager.rb +88 -21
- data/lib/gamebox/{aliasing.rb → lib/aliasing.rb} +0 -0
- data/lib/gamebox/{templates/template_app/lib → lib}/diy.rb +0 -0
- data/lib/gamebox/{inflections.rb → lib/inflections.rb} +0 -0
- data/lib/gamebox/{inflector.rb → lib/inflector.rb} +2 -2
- data/lib/gamebox/{linked_list.rb → lib/linked_list.rb} +0 -0
- data/lib/gamebox/{metaclass.rb → lib/metaclass.rb} +0 -0
- data/lib/gamebox/lib/numbers_ext.rb +3 -0
- data/lib/gamebox/{platform.rb → lib/platform.rb} +0 -0
- data/lib/gamebox/{publisher_ext.rb → lib/publisher_ext.rb} +0 -0
- data/lib/gamebox/{sorted_list.rb → lib/sorted_list.rb} +0 -0
- data/lib/gamebox/lib/surface_ext.rb +76 -0
- data/lib/gamebox/physical_director.rb +1 -1
- data/lib/gamebox/{physical_level.rb → physical_stage.rb} +28 -18
- data/lib/gamebox/physics.rb +2 -2
- data/lib/gamebox/resource_manager.rb +77 -8
- data/lib/gamebox/sound_manager.rb +15 -17
- data/lib/gamebox/stage.rb +143 -0
- data/lib/gamebox/stage_manager.rb +110 -0
- data/lib/gamebox/svg_document.rb +1 -1
- data/lib/gamebox/tasks/gamebox_tasks.rb +1 -1
- data/lib/gamebox/templates/{test_actor.erb → actor_spec.erb} +2 -2
- data/lib/gamebox/templates/actor_view.erb +8 -0
- data/lib/gamebox/templates/actor_view_spec.erb +10 -0
- data/lib/gamebox/templates/template_app/Rakefile +4 -4
- data/lib/gamebox/templates/template_app/config/game.yml +1 -0
- data/lib/gamebox/templates/template_app/config/stage_config.yml +2 -0
- data/lib/gamebox/templates/template_app/script/generate +2 -1
- data/lib/gamebox/templates/template_app/{test → spec}/helper.rb +0 -0
- data/lib/gamebox/templates/template_app/src/{demo_level.rb → demo_stage.rb} +5 -3
- data/lib/gamebox/templates/template_app/src/game.rb +4 -6
- data/lib/gamebox/version.rb +3 -2
- data/lib/gamebox/viewport.rb +18 -9
- data/lib/gamebox/{graphical_actor_view.rb → views/graphical_actor_view.rb} +13 -1
- data/lib/gamebox/wrapped_screen.rb +2 -1
- data/spec/actor_spec.rb +57 -0
- data/{test/test_animated.rb → spec/animated_spec.rb} +5 -6
- data/spec/helper.rb +24 -0
- data/{test/test_line_of_site.rb → spec/line_of_site_spec.rb} +1 -1
- data/{test/test_physical.rb → spec/physical_spec.rb} +3 -4
- data/{test/test_polaris.rb → spec/polaris_spec.rb} +1 -1
- data/{test/test_viewport.rb → spec/viewport_spec.rb} +11 -8
- metadata +53 -50
- data/docs/gamebox04_big.png +0 -0
- data/lib/gamebox/level.rb +0 -65
- data/lib/gamebox/mode.rb +0 -123
- data/lib/gamebox/mode_manager.rb +0 -80
- data/lib/gamebox/numbers_ext.rb +0 -3
- data/lib/gamebox/surface_ext.rb +0 -37
- data/lib/gamebox/templates/template_app/config/mode_level_config.yml +0 -3
- data/test/helper.rb +0 -26
- data/test/test_actor.rb +0 -36
data/lib/gamebox/actor_view.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class ActorView
|
2
|
-
attr_accessor :actor, :
|
3
|
-
def initialize(
|
4
|
-
@
|
2
|
+
attr_accessor :actor, :stage, :layer, :parallax
|
3
|
+
def initialize(stage, actor)
|
4
|
+
@stage = stage
|
5
5
|
@actor = actor
|
6
6
|
|
7
7
|
@layer = 0
|
@@ -12,15 +12,15 @@ class ActorView
|
|
12
12
|
end
|
13
13
|
|
14
14
|
actor.when :remove_me do
|
15
|
-
@
|
15
|
+
@stage.unregister_drawable self
|
16
16
|
end
|
17
17
|
|
18
18
|
actor.when :hide_me do
|
19
|
-
@
|
19
|
+
@stage.unregister_drawable self
|
20
20
|
end
|
21
21
|
|
22
22
|
actor.when :show_me do
|
23
|
-
@
|
23
|
+
@stage.register_drawable self
|
24
24
|
end
|
25
25
|
|
26
26
|
setup
|
File without changes
|
@@ -3,7 +3,7 @@ class ScoreView < ActorView
|
|
3
3
|
text = @actor.score.to_s
|
4
4
|
text = '0'*(6-text.size)+text
|
5
5
|
|
6
|
-
font = @
|
6
|
+
font = @stage.resource_manager.load_font 'Asimov.ttf', 30
|
7
7
|
text_image = font.render text, true, [250,250,250,255]
|
8
8
|
|
9
9
|
x = @actor.x
|
@@ -13,6 +13,7 @@ class ScoreView < ActorView
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
class Score < Actor
|
16
|
+
has_behavior :layered => {:layer => 999}
|
16
17
|
attr_accessor :score
|
17
18
|
|
18
19
|
def setup
|
@@ -15,12 +15,11 @@ class SvgActor < Actor
|
|
15
15
|
|
16
16
|
my_layer = @svg_doc.find_group_by_label(@name.to_s)
|
17
17
|
build_from_vertices my_layer.path.vertices
|
18
|
-
hide unless my_layer.path.visible?
|
19
18
|
end
|
20
19
|
|
21
20
|
def build_from_vertices(vertices)
|
22
21
|
|
23
|
-
moment_of_inertia,mass = Float::
|
22
|
+
moment_of_inertia,mass = Float::INFINITY,Float::INFINITY
|
24
23
|
terrain_body = CP::Body.new(mass,moment_of_inertia)
|
25
24
|
elasticity = 0
|
26
25
|
friction = 0.7
|
@@ -33,7 +32,7 @@ class SvgActor < Actor
|
|
33
32
|
seg.u = friction
|
34
33
|
seg.group = :terrain
|
35
34
|
@segments << [a,b]
|
36
|
-
@
|
35
|
+
@stage.space.add_static_shape(seg)
|
37
36
|
end
|
38
37
|
end
|
39
38
|
end
|
@@ -46,4 +45,4 @@ class SvgActorView < ActorView
|
|
46
45
|
target.draw_line_s [p1.x+x_off,p1.y+y_off], [p2.x+x_off,p2.y+y_off], [25,255,25,255], 6
|
47
46
|
end
|
48
47
|
end
|
49
|
-
end
|
48
|
+
end
|
data/lib/gamebox/ai/polaris.rb
CHANGED
@@ -10,6 +10,8 @@ class Polaris
|
|
10
10
|
@nodes_considered = 0
|
11
11
|
end
|
12
12
|
|
13
|
+
# Returns the path without the from location.
|
14
|
+
# Returns nil if max_depth is hit or if no path exists.
|
13
15
|
def guide(from, to, unit_type=nil, max_depth=400)
|
14
16
|
return nil if @map.blocked?(from, unit_type) || @map.blocked?(to, unit_type)
|
15
17
|
from_element = PathElement.new(from)
|
data/lib/gamebox/behavior.rb
CHANGED
@@ -4,11 +4,11 @@ require 'behavior'
|
|
4
4
|
# by default it expects images to be:
|
5
5
|
# data/graphics/classname/action/01..n.png
|
6
6
|
class Animated < Behavior
|
7
|
-
|
8
|
-
|
9
|
-
attr_accessor :frame_time, :frame_num, :animating
|
7
|
+
attr_accessor :frame_time, :frame_num, :animating, :frame_update_time
|
10
8
|
def setup
|
11
9
|
@images = {}
|
10
|
+
@frame_update_time = @opts[:frame_update_time]
|
11
|
+
@frame_update_time ||= 60
|
12
12
|
@frame_time = 0
|
13
13
|
|
14
14
|
# all animated actors have to have an idle animation
|
@@ -29,6 +29,9 @@ class Animated < Behavior
|
|
29
29
|
define_method :stop_animating do
|
30
30
|
animated_obj.stop_animating
|
31
31
|
end
|
32
|
+
define_method :action do
|
33
|
+
animated_obj.action
|
34
|
+
end
|
32
35
|
define_method :action= do |action_sym|
|
33
36
|
animated_obj.action = action_sym
|
34
37
|
end
|
@@ -43,9 +46,9 @@ class Animated < Behavior
|
|
43
46
|
def update(time)
|
44
47
|
return unless @animating
|
45
48
|
@frame_time += time
|
46
|
-
if @frame_time >
|
49
|
+
if @frame_time > @frame_update_time
|
47
50
|
next_frame
|
48
|
-
@frame_time = @frame_time
|
51
|
+
@frame_time = @frame_time-@frame_update_time
|
49
52
|
end
|
50
53
|
end
|
51
54
|
|
@@ -58,6 +61,10 @@ class Animated < Behavior
|
|
58
61
|
@actor.resource_manager.load_animation_set @actor, action
|
59
62
|
end
|
60
63
|
|
64
|
+
def action
|
65
|
+
@action
|
66
|
+
end
|
67
|
+
|
61
68
|
def action=(new_action)
|
62
69
|
@images[new_action] ||= load_action(new_action)
|
63
70
|
if @images[new_action].size > 1
|
@@ -81,4 +88,5 @@ class Animated < Behavior
|
|
81
88
|
def stop_animating
|
82
89
|
@animating = false
|
83
90
|
end
|
91
|
+
|
84
92
|
end
|
@@ -4,10 +4,15 @@ require 'behavior'
|
|
4
4
|
# data/graphics/classname.png
|
5
5
|
class Graphical < Behavior
|
6
6
|
|
7
|
-
attr_accessor :image
|
7
|
+
attr_accessor :image, :num_x_tiles, :num_y_tiles
|
8
8
|
def setup
|
9
9
|
|
10
10
|
@image = @actor.resource_manager.load_actor_image @actor
|
11
|
+
@tiled = @opts[:tiled]
|
12
|
+
@num_x_tiles = @opts[:num_x_tiles]
|
13
|
+
@num_y_tiles = @opts[:num_y_tiles]
|
14
|
+
@num_x_tiles ||= 1
|
15
|
+
@num_y_tiles ||= 1
|
11
16
|
|
12
17
|
graphical_obj = self
|
13
18
|
@actor.instance_eval do
|
@@ -21,4 +26,9 @@ class Graphical < Behavior
|
|
21
26
|
end
|
22
27
|
end
|
23
28
|
end
|
29
|
+
|
30
|
+
def tiled?
|
31
|
+
@tiled
|
32
|
+
end
|
33
|
+
|
24
34
|
end
|
@@ -19,6 +19,12 @@ class Layered < Behavior
|
|
19
19
|
layered_obj = self
|
20
20
|
@actor.instance_eval do
|
21
21
|
(class << self; self; end).class_eval do
|
22
|
+
define_method :layer= do |new_layer|
|
23
|
+
layered_obj.layer = new_layer
|
24
|
+
end
|
25
|
+
define_method :parallax= do |new_parallax|
|
26
|
+
layered_obj.parallax = new_parallax
|
27
|
+
end
|
22
28
|
define_method :layer do
|
23
29
|
layered_obj.layer
|
24
30
|
end
|
@@ -31,4 +37,12 @@ class Layered < Behavior
|
|
31
37
|
end
|
32
38
|
end
|
33
39
|
end
|
40
|
+
|
41
|
+
def parallax=(new_parallax)
|
42
|
+
@parallax = new_parallax
|
43
|
+
end
|
44
|
+
|
45
|
+
def layer=(new_layer)
|
46
|
+
@layer = new_layer
|
47
|
+
end
|
34
48
|
end
|
@@ -2,8 +2,21 @@ require 'physics'
|
|
2
2
|
require 'behavior'
|
3
3
|
require 'inflector'
|
4
4
|
require 'publisher'
|
5
|
+
|
6
|
+
# Physical behavior will place your Actor in a physical world.
|
7
|
+
# example:
|
8
|
+
# :physical => {
|
9
|
+
# :shape => :poly,
|
10
|
+
# :parts => [
|
11
|
+
# :nario_feet => {:verts => [[-13,20],[-13,21],[13,21],[13,20]],:shape=>:poly, :offset => vec2(0,6)},
|
12
|
+
# :nario_hat => {:verts => [[-8,20],[-8,21],[8,21],[8,20]],:shape=>:poly, :offset => vec2(0,-46)}
|
13
|
+
# ],
|
14
|
+
# :mass => 200,
|
15
|
+
# :friction => 0.4,
|
16
|
+
# :moment => Float::INFINITY,
|
17
|
+
# :verts => [[-15,-20],[-15,20],[15,20],[15,-20]]}
|
5
18
|
class Physical < Behavior
|
6
|
-
attr_accessor :shapes, :body, :opts, :parts
|
19
|
+
attr_accessor :shapes, :body, :opts, :parts, :segments_groups
|
7
20
|
|
8
21
|
def shape
|
9
22
|
@shapes.first if @shapes
|
@@ -12,9 +25,10 @@ class Physical < Behavior
|
|
12
25
|
def setup
|
13
26
|
# TODO add defaults?
|
14
27
|
@mass = @opts[:mass]
|
15
|
-
@mass ||= Float::
|
28
|
+
@mass ||= Float::INFINITY
|
16
29
|
@parts = {}
|
17
30
|
@shapes = []
|
31
|
+
@segments_groups = []
|
18
32
|
|
19
33
|
moment_of_inertia = @opts[:moment]
|
20
34
|
|
@@ -22,16 +36,19 @@ class Physical < Behavior
|
|
22
36
|
when :circle
|
23
37
|
@radius = @opts[:radius]
|
24
38
|
|
25
|
-
moment_of_inertia ||= @opts[:fixed] ? Float::
|
39
|
+
moment_of_inertia ||= @opts[:fixed] ? Float::INFINITY : moment_for_circle(@mass, @radius, 0, ZERO_VEC_2)
|
26
40
|
@body = Body.new(@mass, moment_of_inertia)
|
27
|
-
@shape = Shape::Circle.new(@body, @radius,
|
41
|
+
@shape = Shape::Circle.new(@body, @radius, ZERO_VEC_2)
|
28
42
|
|
29
43
|
when :poly
|
30
44
|
shape_array = @opts[:verts].collect{|v| vec2(v[0],v[1])}
|
31
45
|
|
32
|
-
moment_of_inertia ||= @opts[:fixed] ? Float::
|
46
|
+
moment_of_inertia ||= @opts[:fixed] ? Float::INFINITY : moment_for_poly(@mass, shape_array, ZERO_VEC_2)
|
33
47
|
@body = Body.new(@mass, moment_of_inertia)
|
34
|
-
@shape = Shape::Poly.new(@body, shape_array,
|
48
|
+
@shape = Shape::Poly.new(@body, shape_array, ZERO_VEC_2)
|
49
|
+
verts = @opts[:verts].dup
|
50
|
+
verts << @opts[:verts][0]
|
51
|
+
@segments_groups << verts
|
35
52
|
end
|
36
53
|
|
37
54
|
collision_type = @opts[:collision_group]
|
@@ -46,15 +63,19 @@ class Physical < Behavior
|
|
46
63
|
start_x ||= @actor.x
|
47
64
|
start_y ||= @actor.y
|
48
65
|
@shape.body.p = vec2(start_x,start_y)
|
49
|
-
|
66
|
+
|
67
|
+
elasticity = @opts[:elasticity]
|
68
|
+
elasticity ||= 0.1
|
69
|
+
@shape.e = elasticity
|
70
|
+
|
50
71
|
friction = @opts[:friction]
|
51
72
|
friction ||= 0.4
|
52
73
|
@shape.u = friction
|
53
74
|
|
54
75
|
@shapes << @shape
|
55
76
|
|
56
|
-
if @opts[:
|
57
|
-
for obj in @opts[:
|
77
|
+
if @opts[:shapes]
|
78
|
+
for obj in @opts[:shapes]
|
58
79
|
for part_name, part_def in obj
|
59
80
|
# add another shape here
|
60
81
|
part_shape_array = part_def[:verts].collect{|v| vec2(v[0],v[1])}
|
@@ -63,6 +84,9 @@ class Physical < Behavior
|
|
63
84
|
# TODO pass all physics params to parts (ie u and e)
|
64
85
|
part_shape.u = friction
|
65
86
|
@shapes << part_shape
|
87
|
+
verts = part_def[:verts].dup
|
88
|
+
verts << part_def[:verts][0]
|
89
|
+
@segments_groups << verts
|
66
90
|
end
|
67
91
|
end
|
68
92
|
end
|
@@ -70,14 +94,14 @@ class Physical < Behavior
|
|
70
94
|
|
71
95
|
physical_obj = self
|
72
96
|
|
73
|
-
if @actor.
|
97
|
+
if @actor.stage.respond_to? :register_physical_object
|
74
98
|
if @opts[:fixed]
|
75
|
-
@actor.
|
99
|
+
@actor.stage.register_physical_object physical_obj, true
|
76
100
|
else
|
77
|
-
@actor.
|
101
|
+
@actor.stage.register_physical_object physical_obj
|
78
102
|
end
|
79
103
|
else
|
80
|
-
raise "physical actor in a non-physical
|
104
|
+
raise "physical actor in a non-physical stage!"
|
81
105
|
end
|
82
106
|
|
83
107
|
# write code here to keep physics and x,y of actor in sync
|
@@ -114,7 +138,10 @@ class Physical < Behavior
|
|
114
138
|
end
|
115
139
|
define_method :warp do |new_p|
|
116
140
|
physical_obj.body.p = new_p
|
117
|
-
@
|
141
|
+
@stage.space.rehash_static if physical_obj.opts[:fixed]
|
142
|
+
end
|
143
|
+
define_method :segment_groups do
|
144
|
+
physical_obj.segments_groups
|
118
145
|
end
|
119
146
|
define_method :physical do
|
120
147
|
physical_obj
|
@@ -3,9 +3,9 @@ game:
|
|
3
3
|
- wrapped_screen
|
4
4
|
- input_manager
|
5
5
|
- sound_manager
|
6
|
-
-
|
6
|
+
- stage_manager
|
7
7
|
resource_manager:
|
8
|
-
|
8
|
+
stage_manager:
|
9
9
|
compose:
|
10
10
|
- input_manager
|
11
11
|
- resource_manager
|
@@ -17,6 +17,8 @@ sound_manager:
|
|
17
17
|
- resource_manager
|
18
18
|
- config_manager
|
19
19
|
input_manager:
|
20
|
+
compose:
|
21
|
+
- config_manager
|
20
22
|
wrapped_screen:
|
21
23
|
compose:
|
22
24
|
- config_manager
|
Binary file
|
@@ -0,0 +1,285 @@
|
|
1
|
+
|
2
|
+
# Basic event compatibility layer. Should allow most Gamebox games
|
3
|
+
# that use old-style Rubygame events to run using new-style events
|
4
|
+
# under the hood without even knowing it.
|
5
|
+
|
6
|
+
|
7
|
+
ExposeEvent = Rubygame::Events::WindowExposed
|
8
|
+
KeyDownEvent = Rubygame::Events::KeyPressed
|
9
|
+
KeyUpEvent = Rubygame::Events::KeyReleased
|
10
|
+
MouseDownEvent = Rubygame::Events::MousePressed
|
11
|
+
MouseUpEvent = Rubygame::Events::MouseReleased
|
12
|
+
MouseMotionEvent = Rubygame::Events::MouseMoved
|
13
|
+
QuitEvent = Rubygame::Events::QuitRequested
|
14
|
+
ResizeEvent = Rubygame::Events::WindowResized
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
K_BACKSPACE = :backspace
|
20
|
+
K_TAB = :tab
|
21
|
+
K_CLEAR = :clear
|
22
|
+
K_RETURN = :return
|
23
|
+
K_PAUSE = :pause
|
24
|
+
K_ESCAPE = :escape
|
25
|
+
K_SPACE = :space
|
26
|
+
K_EXCLAIM = :exclamation_mark
|
27
|
+
K_QUOTEDBL = :double_quote
|
28
|
+
K_HASH = :hash
|
29
|
+
K_DOLLAR = :dollar
|
30
|
+
K_AMPERSAND = :ampersand
|
31
|
+
K_QUOTE = :quote
|
32
|
+
K_LEFTPAREN = :left_parenthesis
|
33
|
+
K_RIGHTPAREN = :right_parenthesis
|
34
|
+
K_ASTERISK = :asterisk
|
35
|
+
K_PLUS = :plus
|
36
|
+
K_COMMA = :comma
|
37
|
+
K_MINUS = :minus
|
38
|
+
K_PERIOD = :period
|
39
|
+
K_SLASH = :slash
|
40
|
+
K_0 = :number_0
|
41
|
+
K_1 = :number_1
|
42
|
+
K_2 = :number_2
|
43
|
+
K_3 = :number_3
|
44
|
+
K_4 = :number_4
|
45
|
+
K_5 = :number_5
|
46
|
+
K_6 = :number_6
|
47
|
+
K_7 = :number_7
|
48
|
+
K_8 = :number_8
|
49
|
+
K_9 = :number_9
|
50
|
+
K_COLON = :colon
|
51
|
+
K_SEMICOLON = :semicolon
|
52
|
+
K_LESS = :less_than
|
53
|
+
K_EQUALS = :equals
|
54
|
+
K_GREATER = :greater_than
|
55
|
+
K_QUESTION = :question_mark
|
56
|
+
K_AT = :at
|
57
|
+
K_LEFTBRACKET = :left_bracket
|
58
|
+
K_BACKSLASH = :backslash
|
59
|
+
K_RIGHTBRACKET = :right_bracket
|
60
|
+
K_CARET = :caret
|
61
|
+
K_UNDERSCORE = :underscore
|
62
|
+
K_BACKQUOTE = :backquote
|
63
|
+
K_A = :a
|
64
|
+
K_B = :b
|
65
|
+
K_C = :c
|
66
|
+
K_D = :d
|
67
|
+
K_E = :e
|
68
|
+
K_F = :f
|
69
|
+
K_G = :g
|
70
|
+
K_H = :h
|
71
|
+
K_I = :i
|
72
|
+
K_J = :j
|
73
|
+
K_K = :k
|
74
|
+
K_L = :l
|
75
|
+
K_M = :m
|
76
|
+
K_N = :n
|
77
|
+
K_O = :o
|
78
|
+
K_P = :p
|
79
|
+
K_Q = :q
|
80
|
+
K_R = :r
|
81
|
+
K_S = :s
|
82
|
+
K_T = :t
|
83
|
+
K_U = :u
|
84
|
+
K_V = :v
|
85
|
+
K_W = :w
|
86
|
+
K_X = :x
|
87
|
+
K_Y = :y
|
88
|
+
K_Z = :z
|
89
|
+
K_DELETE = :delete
|
90
|
+
|
91
|
+
|
92
|
+
# International keyboard symbols
|
93
|
+
K_WORLD_0 = :world_0
|
94
|
+
K_WORLD_1 = :world_1
|
95
|
+
K_WORLD_2 = :world_2
|
96
|
+
K_WORLD_3 = :world_3
|
97
|
+
K_WORLD_4 = :world_4
|
98
|
+
K_WORLD_5 = :world_5
|
99
|
+
K_WORLD_6 = :world_6
|
100
|
+
K_WORLD_7 = :world_7
|
101
|
+
K_WORLD_8 = :world_8
|
102
|
+
K_WORLD_9 = :world_9
|
103
|
+
K_WORLD_10 = :world_10
|
104
|
+
K_WORLD_11 = :world_11
|
105
|
+
K_WORLD_12 = :world_12
|
106
|
+
K_WORLD_13 = :world_13
|
107
|
+
K_WORLD_14 = :world_14
|
108
|
+
K_WORLD_15 = :world_15
|
109
|
+
K_WORLD_16 = :world_16
|
110
|
+
K_WORLD_17 = :world_17
|
111
|
+
K_WORLD_18 = :world_18
|
112
|
+
K_WORLD_19 = :world_19
|
113
|
+
K_WORLD_20 = :world_20
|
114
|
+
K_WORLD_21 = :world_21
|
115
|
+
K_WORLD_22 = :world_22
|
116
|
+
K_WORLD_23 = :world_23
|
117
|
+
K_WORLD_24 = :world_24
|
118
|
+
K_WORLD_25 = :world_25
|
119
|
+
K_WORLD_26 = :world_26
|
120
|
+
K_WORLD_27 = :world_27
|
121
|
+
K_WORLD_28 = :world_28
|
122
|
+
K_WORLD_29 = :world_29
|
123
|
+
K_WORLD_30 = :world_30
|
124
|
+
K_WORLD_31 = :world_31
|
125
|
+
K_WORLD_32 = :world_32
|
126
|
+
K_WORLD_33 = :world_33
|
127
|
+
K_WORLD_34 = :world_34
|
128
|
+
K_WORLD_35 = :world_35
|
129
|
+
K_WORLD_36 = :world_36
|
130
|
+
K_WORLD_37 = :world_37
|
131
|
+
K_WORLD_38 = :world_38
|
132
|
+
K_WORLD_39 = :world_39
|
133
|
+
K_WORLD_40 = :world_40
|
134
|
+
K_WORLD_41 = :world_41
|
135
|
+
K_WORLD_42 = :world_42
|
136
|
+
K_WORLD_43 = :world_43
|
137
|
+
K_WORLD_44 = :world_44
|
138
|
+
K_WORLD_45 = :world_45
|
139
|
+
K_WORLD_46 = :world_46
|
140
|
+
K_WORLD_47 = :world_47
|
141
|
+
K_WORLD_48 = :world_48
|
142
|
+
K_WORLD_49 = :world_49
|
143
|
+
K_WORLD_50 = :world_50
|
144
|
+
K_WORLD_51 = :world_51
|
145
|
+
K_WORLD_52 = :world_52
|
146
|
+
K_WORLD_53 = :world_53
|
147
|
+
K_WORLD_54 = :world_54
|
148
|
+
K_WORLD_55 = :world_55
|
149
|
+
K_WORLD_56 = :world_56
|
150
|
+
K_WORLD_57 = :world_57
|
151
|
+
K_WORLD_58 = :world_58
|
152
|
+
K_WORLD_59 = :world_59
|
153
|
+
K_WORLD_60 = :world_60
|
154
|
+
K_WORLD_61 = :world_61
|
155
|
+
K_WORLD_62 = :world_62
|
156
|
+
K_WORLD_63 = :world_63
|
157
|
+
K_WORLD_64 = :world_64
|
158
|
+
K_WORLD_65 = :world_65
|
159
|
+
K_WORLD_66 = :world_66
|
160
|
+
K_WORLD_67 = :world_67
|
161
|
+
K_WORLD_68 = :world_68
|
162
|
+
K_WORLD_69 = :world_69
|
163
|
+
K_WORLD_70 = :world_70
|
164
|
+
K_WORLD_71 = :world_71
|
165
|
+
K_WORLD_72 = :world_72
|
166
|
+
K_WORLD_73 = :world_73
|
167
|
+
K_WORLD_74 = :world_74
|
168
|
+
K_WORLD_75 = :world_75
|
169
|
+
K_WORLD_76 = :world_76
|
170
|
+
K_WORLD_77 = :world_77
|
171
|
+
K_WORLD_78 = :world_78
|
172
|
+
K_WORLD_79 = :world_79
|
173
|
+
K_WORLD_80 = :world_80
|
174
|
+
K_WORLD_81 = :world_81
|
175
|
+
K_WORLD_82 = :world_82
|
176
|
+
K_WORLD_83 = :world_83
|
177
|
+
K_WORLD_84 = :world_84
|
178
|
+
K_WORLD_85 = :world_85
|
179
|
+
K_WORLD_86 = :world_86
|
180
|
+
K_WORLD_87 = :world_87
|
181
|
+
K_WORLD_88 = :world_88
|
182
|
+
K_WORLD_89 = :world_89
|
183
|
+
K_WORLD_90 = :world_90
|
184
|
+
K_WORLD_91 = :world_91
|
185
|
+
K_WORLD_92 = :world_92
|
186
|
+
K_WORLD_93 = :world_93
|
187
|
+
K_WORLD_94 = :world_94
|
188
|
+
K_WORLD_95 = :world_95
|
189
|
+
|
190
|
+
|
191
|
+
# Numeric keypad symbols
|
192
|
+
K_KP0 = :keypad_0
|
193
|
+
K_KP1 = :keypad_1
|
194
|
+
K_KP2 = :keypad_2
|
195
|
+
K_KP3 = :keypad_3
|
196
|
+
K_KP4 = :keypad_4
|
197
|
+
K_KP5 = :keypad_5
|
198
|
+
K_KP6 = :keypad_6
|
199
|
+
K_KP7 = :keypad_7
|
200
|
+
K_KP8 = :keypad_8
|
201
|
+
K_KP9 = :keypad_9
|
202
|
+
K_KP_PERIOD = :keypad_period
|
203
|
+
K_KP_DIVIDE = :keypad_divide
|
204
|
+
K_KP_MULTIPLY = :keypad_multiply
|
205
|
+
K_KP_MINUS = :keypad_minus
|
206
|
+
K_KP_PLUS = :keypad_plus
|
207
|
+
K_KP_ENTER = :keypad_enter
|
208
|
+
K_KP_EQUALS = :keypad_equals
|
209
|
+
|
210
|
+
|
211
|
+
# Arrows + Home/End pad
|
212
|
+
K_UP = :up
|
213
|
+
K_DOWN = :down
|
214
|
+
K_RIGHT = :right
|
215
|
+
K_LEFT = :left
|
216
|
+
K_INSERT = :insert
|
217
|
+
K_HOME = :home
|
218
|
+
K_END = :end
|
219
|
+
K_PAGEUP = :pageup
|
220
|
+
K_PAGEDOWN = :pagedown
|
221
|
+
|
222
|
+
|
223
|
+
# Function keys
|
224
|
+
K_F1 = :f1
|
225
|
+
K_F2 = :f2
|
226
|
+
K_F3 = :f3
|
227
|
+
K_F4 = :f4
|
228
|
+
K_F5 = :f5
|
229
|
+
K_F6 = :f6
|
230
|
+
K_F7 = :f7
|
231
|
+
K_F8 = :f8
|
232
|
+
K_F9 = :f9
|
233
|
+
K_F10 = :f10
|
234
|
+
K_F11 = :f11
|
235
|
+
K_F12 = :f12
|
236
|
+
K_F13 = :f13
|
237
|
+
K_F14 = :f14
|
238
|
+
K_F15 = :f15
|
239
|
+
|
240
|
+
|
241
|
+
# Key state modifier keys
|
242
|
+
K_NUMLOCK = :numlock
|
243
|
+
K_CAPSLOCK = :capslock
|
244
|
+
K_SCROLLOCK = :scrollock
|
245
|
+
K_RSHIFT = :right_shift
|
246
|
+
K_LSHIFT = :left_shift
|
247
|
+
K_RCTRL = :right_ctrl
|
248
|
+
K_LCTRL = :left_ctrl
|
249
|
+
K_RALT = :right_alt
|
250
|
+
K_LALT = :left_alt
|
251
|
+
K_RMETA = :right_meta
|
252
|
+
K_LMETA = :left_meta
|
253
|
+
K_LSUPER = :left_super
|
254
|
+
K_RSUPER = :right_super
|
255
|
+
K_MODE = :mode
|
256
|
+
|
257
|
+
|
258
|
+
# Miscellaneous keys
|
259
|
+
K_HELP = :help
|
260
|
+
K_PRINT = :print
|
261
|
+
K_SYSREQ = :sysreq
|
262
|
+
K_BREAK = :break
|
263
|
+
K_MENU = :menu
|
264
|
+
K_POWER = :power
|
265
|
+
K_EURO = :euro
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
# Mouse constants
|
270
|
+
MOUSE_LEFT = :mouse_left
|
271
|
+
MOUSE_MIDDLE = :mouse_middle
|
272
|
+
MOUSE_RIGHT = :mouse_right
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
# Joystick constants
|
277
|
+
HAT_CENTERED = nil
|
278
|
+
HAT_UP = :up
|
279
|
+
HAT_RIGHT = :right
|
280
|
+
HAT_DOWN = :down
|
281
|
+
HAT_LEFT = :left
|
282
|
+
HAT_RIGHTUP = :up_right
|
283
|
+
HAT_RIGHTDOWN = :down_right
|
284
|
+
HAT_LEFTUP = :up_left
|
285
|
+
HAT_LEFTDOWN = :down_left
|