getch

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: BSD-3-Clause Imports: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (
	RIGHT_ALT_PRESSED  = 1
	LEFT_ALT_PRESSED   = 2
	RIGHT_CTRL_PRESSED = 4
	LEFT_CTRL_PRESSED  = 8
	CTRL_PRESSED       = RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED
	ALT_PRESSED        = RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED
)
View Source
const (
	FROM_LEFT_1ST_BUTTON_PRESSED = 0x0001
	FROM_LEFT_2ND_BUTTON_PRESSED = 0x0004
	FROM_LEFT_3RD_BUTTON_PRESSED = 0x0008
	FROM_LEFT_4TH_BUTTON_PRESSED = 0x0010
	RIGHTMOST_BUTTON_PRESSED     = 0x0002
)
View Source
const ALL_EVENTS = consoleinput.ENABLE_WINDOW_INPUT | consoleinput.ENABLE_MOUSE_INPUT
View Source
const IGNORE_RESIZE_EVENT uint32 = 0
View Source
const NUL = '\000'

Variables

This section is empty.

Functions

func Count

func Count() (int, error)

func DisableCtrlC

func DisableCtrlC()

func Flush

func Flush() error

func IsCtrlCPressed

func IsCtrlCPressed() bool

func Rune

func Rune() rune

Get character as a Rune

func RuneWithin

func RuneWithin(msec uintptr) (rune, error)

func Wait

func Wait(timeout_msec uintptr) (bool, error)

wait for keyboard event

Types

type Event

type Event struct {
	Focus   *struct{} // MS says it should be ignored
	Key     *keyEvent // == KeyDown
	KeyDown *keyEvent
	KeyUp   *keyEvent
	Menu    *struct{}                      // MS says it should be ignored
	Mouse   *consoleinput.MouseEventRecord // not supported,yet
	Resize  *resizeEvent
}

func All

func All() Event

Get all console-event (keyboard,resize,...)

func Within

func Within(msec uintptr) (Event, error)

func (Event) String

func (e Event) String() string

type Handle

type Handle struct {
	consoleinput.Handle
	// contains filtered or unexported fields
}

func New

func New() *Handle

func (*Handle) All

func (h *Handle) All() Event

Get all console-event (keyboard,resize,...)

func (*Handle) Close

func (h *Handle) Close()

func (*Handle) DisableCtrlC

func (h *Handle) DisableCtrlC()

func (*Handle) Flush

func (h *Handle) Flush() error

func (*Handle) IsCtrlCPressed

func (h *Handle) IsCtrlCPressed() bool

func (*Handle) Rune

func (h *Handle) Rune() rune

Get character as a Rune

func (*Handle) RuneWithin

func (h *Handle) RuneWithin(msec uintptr) (rune, error)

func (*Handle) Wait

func (h *Handle) Wait(timeout_msec uintptr) (bool, error)

wait for keyboard event

func (*Handle) Within

func (h *Handle) Within(msec uintptr) (Event, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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