cycle in reverse with left
This commit is contained in:
parent
21c0e3f447
commit
9e8aff813e
|
@ -39,6 +39,8 @@ func handleKeyboardEvent(event *sdl.KeyboardEvent, m *milkDropWindow) {
|
||||||
scancode := event.Keysym.Scancode
|
scancode := event.Keysym.Scancode
|
||||||
if event.Type == sdl.KEYDOWN && scancode == sdl.SCANCODE_RIGHT {
|
if event.Type == sdl.KEYDOWN && scancode == sdl.SCANCODE_RIGHT {
|
||||||
m.nextPreset()
|
m.nextPreset()
|
||||||
|
} else if event.Type == sdl.KEYDOWN && scancode == sdl.SCANCODE_LEFT {
|
||||||
|
m.prevPreset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,11 @@ func (m *milkDropWindow) nextPreset() {
|
||||||
m.loadPreset(m.preset.Value.(string))
|
m.loadPreset(m.preset.Value.(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *milkDropWindow) prevPreset() {
|
||||||
|
m.preset = m.preset.Prev()
|
||||||
|
m.loadPreset(m.preset.Value.(string))
|
||||||
|
}
|
||||||
|
|
||||||
func newMilkDropWindow(width, height int32, scriptPath string) (*milkDropWindow, error) {
|
func newMilkDropWindow(width, height int32, scriptPath string) (*milkDropWindow, error) {
|
||||||
var m milkDropWindow
|
var m milkDropWindow
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in New Issue