2018-09-05 13:53:09 +00:00
|
|
|
package main
|
|
|
|
|
2018-09-17 19:56:16 +00:00
|
|
|
import (
|
|
|
|
"github.com/gopherjs/vecty"
|
|
|
|
)
|
2018-09-05 13:53:09 +00:00
|
|
|
|
|
|
|
// KeyListener implements listener for keydown events.
|
|
|
|
func (p *Page) KeyListener(e *vecty.Event) {
|
|
|
|
key := e.Get("key").String()
|
|
|
|
switch key {
|
|
|
|
case "p":
|
2018-09-17 19:11:04 +00:00
|
|
|
p.webgl.ToggleAutoRotation()
|
2018-09-05 13:53:09 +00:00
|
|
|
}
|
|
|
|
}
|