Exemplo n.º 1
0
Arquivo: rt.go Projeto: skyview059/vu
// update handles user input.
func (rt *rtrace) update(dev device.Device) {
	pressed := dev.Update()
	if pressed.Resized {
		_, _, ww, wh := dev.Size()
		gl.Viewport(0, 0, int32(ww), int32(wh))
	}
}
Exemplo n.º 2
0
Arquivo: sh.go Projeto: skyview059/vu
// Show all the concurrent user actions.
func (sh *shtag) update(dev device.Device) {
	pressed := dev.Update()
	if pressed.Scroll != 0 {
		fmt.Printf("scroll %d\n", pressed.Scroll)
	}
	if pressed.Resized {
		_, _, ww, wh := dev.Size()
		fmt.Printf("resized %d %d\n", ww, wh)
	}
	if len(pressed.Down) > 0 {
		fmt.Print(pressed.Mx, ",", pressed.My, ":")
		if pressed.Resized {
			fmt.Print(" resized:")
		}
		if pressed.Focus {
			fmt.Print("   focus:")
		} else {
			fmt.Print(" nofocus:")
		}
		for key, duration := range pressed.Down {
			fmt.Print(key, ",", duration, ":")
		}
		fmt.Println()
	}

	// toggle windowed mode if W is pressed.
	if down, ok := pressed.Down[device.K_W]; ok && down == 1 {
		dev.ToggleFullScreen()
	}
}
Exemplo n.º 3
0
Arquivo: ld.go Projeto: toophy/vu
// update handles user input
func (ld *ldtag) update(dev device.Device) {
	pressed := dev.Update()
	if pressed.Resized {
		ld.resize(dev.Size())
	}
}
Exemplo n.º 4
0
Arquivo: sf.go Projeto: skyview059/vu
// update handles user input.
func (sf *sftag) update(dev device.Device) {
	pressed := dev.Update()
	if pressed.Resized {
		sf.resize(dev.Size())
	}
}