Skip to content

Commit

Permalink
Fix #6: Arrow key input on Slider2D widget
Browse files Browse the repository at this point in the history
  • Loading branch information
vrld committed Mar 24, 2013
1 parent 2c24ba3 commit e6d397e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions slider2d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ return function(w)

if keyboard.hasFocus(id) then
if keyboard.key == 'down' then
w.info.value[2] = math.min(w.info.max[2], w.info.value[2] + w.info.step.y)
w.info.value[2] = math.min(w.info.max[2], w.info.value[2] + w.info.step[2])
changed = true
elseif keyboard.key == 'up' then
w.info.value[2] = math.max(w.info.min[2], w.info.value[2] - w.info.step.y)
w.info.value[2] = math.max(w.info.min[2], w.info.value[2] - w.info.step[2])
changed = true
end
if keyboard.key == 'right' then
w.info.value[1] = math.min(w.info.max[1], w.info.value[1] + w.info.step.x)
w.info.value[1] = math.min(w.info.max[1], w.info.value[1] + w.info.step[1])
changed = true
elseif keyboard.key == 'left' then
w.info.value[1] = math.max(w.info.min[1], w.info.value[1] - w.info.step.x)
w.info.value[1] = math.max(w.info.min[1], w.info.value[1] - w.info.step[1])
changed = true
end
end
Expand Down

0 comments on commit e6d397e

Please sign in to comment.