mirror of
https://github.com/status-im/whispervis.git
synced 2025-02-01 16:04:56 +00:00
19 lines
313 B
Go
19 lines
313 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gopherjs/vecty"
|
|
)
|
|
|
|
// KeyListener implements listener for keydown events.
|
|
func (p *Page) KeyListener(e *vecty.Event) {
|
|
key := e.Get("key").String()
|
|
switch key {
|
|
case "p":
|
|
p.webgl.ToggleAutoRotation()
|
|
case "o":
|
|
p.webgl.ToggleWobbling()
|
|
case "]":
|
|
p.ApplyForces()
|
|
}
|
|
}
|