controllers

package
v0.0.0-...-7d09a16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyboardController

type KeyboardController struct {
	// contains filtered or unexported fields
}

KeyboardController represents a keyboard input controller for the emulator

func NewKeyboardController

func NewKeyboardController(controller nes.InputController) *KeyboardController

NewKeyboardController creates a new keyboard input controller

func (*KeyboardController) GetKeyMapping

func (k *KeyboardController) GetKeyMapping() []glfw.Key

GetKeyMapping returns the list of keys in the mapping

func (*KeyboardController) HandleKey

func (k *KeyboardController) HandleKey(key glfw.Key) bool

HandleKey handles the key input and returns true if it was sucessful, false if the key was not mapped

func (*KeyboardController) Reset

func (k *KeyboardController) Reset()

Reset calls the reset method for the controller to start a read

func (*KeyboardController) SetMapping

func (k *KeyboardController) SetMapping(mappings map[glfw.Key]nes.Button)

SetMapping sets the key mapping

func (*KeyboardController) WithDefaultMapping

func (k *KeyboardController) WithDefaultMapping() *KeyboardController

WithDefaultMapping creates a new keyboard controller with the default mapping W-A-S-D for keypad, N,M for A and B, Enter and Backspace for Start and Select

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL