mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
ebiten: Add inpututil guide comments for Is{Key,MouseButton,Gamepad}Pressed and TouchIDs (#1346)
Fixes #1344
This commit is contained in:
parent
3d333d5be7
commit
e3e8b49047
12
input.go
12
input.go
@ -38,6 +38,9 @@ func InputChars() []rune {
|
||||
|
||||
// IsKeyPressed returns a boolean indicating whether key is pressed.
|
||||
//
|
||||
// If you want to know whether the key started being pressed in the current frame,
|
||||
// use inpututil.IsKeyJustPressed
|
||||
//
|
||||
// Known issue: On Edge browser, some keys don't work well:
|
||||
//
|
||||
// - KeyKPEnter and KeyKPEqual are recognized as KeyEnter and KeyEqual.
|
||||
@ -92,6 +95,9 @@ func Wheel() (xoff, yoff float64) {
|
||||
|
||||
// IsMouseButtonPressed returns a boolean indicating whether mouseButton is pressed.
|
||||
//
|
||||
// If you want to know whether the mouseButton started being pressed in the current frame,
|
||||
// use inpututil.IsMouseButtonJustPressed
|
||||
//
|
||||
// IsMouseButtonPressed is concurrent-safe.
|
||||
//
|
||||
// Note that touch events not longer affect IsMouseButtonPressed's result as of 1.4.0-alpha.
|
||||
@ -163,6 +169,9 @@ func GamepadButtonNum(id int) int {
|
||||
|
||||
// IsGamepadButtonPressed returns the boolean indicating the given button of the gamepad (id) is pressed or not.
|
||||
//
|
||||
// If you want to know whether the given button of gamepad (id) started being pressed in the current frame,
|
||||
// use inpututil.IsGamepadButtonJustPressed
|
||||
//
|
||||
// IsGamepadButtonPressed is concurrent-safe.
|
||||
//
|
||||
// The relationships between physical buttons and buttion IDs depend on environments.
|
||||
@ -175,6 +184,9 @@ func IsGamepadButtonPressed(id int, button GamepadButton) bool {
|
||||
|
||||
// TouchIDs returns the current touch states.
|
||||
//
|
||||
// If you want to know whether a touch started being pressed in the current frame,
|
||||
// use inpututil.JustPressedTouchIDs
|
||||
//
|
||||
// TouchIDs returns nil when there are no touches.
|
||||
// TouchIDs always returns nil on desktops.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user