Skip to content

Commit c2edc5c

Browse files
authored
Merge on-screen keyboard (#211)
There is little to say about the on-screen keyboard, so I've merged it into the keyboard section of a bad page.
1 parent 2a7d8ec commit c2edc5c

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

_includes/wiki_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
* [Gesture detection](/wiki/input/gesture-detection)
9090
* [Gyroscope](/wiki/input/gyroscope)
9191
* [Mouse, Touch and Keyboard](/wiki/input/mouse-touch-and-keyboard)
92-
* [On screen keyboard](/wiki/input/on-screen-keyboard)
9392
* [Polling](/wiki/input/polling)
9493
* [Simple text input](/wiki/input/simple-text-input)
9594
* [Vibrator](/wiki/input/vibrator)

_includes/wiki_sidebar.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
* [Gesture detection](/wiki/input/gesture-detection)
129129
* [Gyroscope](/wiki/input/gyroscope)
130130
* [Mouse, Touch and Keyboard](/wiki/input/mouse-touch-and-keyboard)
131-
* [On screen keyboard](/wiki/input/on-screen-keyboard)
132131
* [Polling](/wiki/input/polling)
133132
* [Simple text input](/wiki/input/simple-text-input)
134133
* [Vibrator](/wiki/input/vibrator)

wiki/input/mouse-touch-and-keyboard.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
title: Mouse, Touch and Keyboard
33
redirect_from:
44
- /wiki/mouse,-touch-&-keyboard
5+
- /wiki/input/on-screen-keyboard
56
---
67
The main input devices libGDX supports are the mouse on the desktop/browser, touch screens on Android and keyboards. Let's review how libGDX abstracts those.
78

89
## Keyboard
9-
Keyboards signal user input by generating events for pressing and releasing a key. Each event carries with it a key-code that identifies the key that was pressed/released. These key-codes differ from platform to platform. libGDX tries to hide this fact by providing its own key-code table, see the [Keys](https://javadoc.io/doc/com.badlogicgames.gdx/gdx/latest/com/badlogic/gdx/Input.Keys.html) [(source)](https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/Input.java#L63) class. You can query which keys are currently being pressed via [Polling](/wiki/input/polling).
10+
Keyboards signal user input by generating events for pressing and releasing a key. Each event carries with it a key-code that identifies the key that was pressed/released. These key-codes differ from platform to platform. libGDX tries to hide this fact by providing its own key-code table, see the [Keys](https://javadoc.io/doc/com.badlogicgames.gdx/gdx/latest/com/badlogic/gdx/Input.Keys.html) [(source)](https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/Input.java#L69) class. You can query which keys are currently being pressed via [Polling](/wiki/input/polling).
1011

1112
Key-codes alone do not give us information about which character the user actually entered. This information is often derived from the state of multiple keys, e.g. the character 'A' is generated by the keys 'a' and 'shift' being pressed simultaneously. In general, deriving characters from the keyboard's state (which keys are down) is non-trivial. Thankfully, the operating system usually has a means to hook up an event listener that not only reports key-code events (key pressed/key released), but also characters. libGDX uses this mechanism under the hood to provide you with character information. See [Event Handling](/wiki/input/event-handling).
1213

14+
As most Android and iOS devices lack a physical keyboard, we can use `Gdx.input.setOnscreenKeyboardVisible(true)` to bring up the on-screen keyboard. It is also possible to specify which type of keyboard to display by passing in an [`OnscreenKeyboardType`](https://javadoc.io/doc/com.badlogicgames.gdx/gdx/latest/com/badlogic/gdx/Input.OnscreenKeyboardType.html).
15+
1316
## Mouse & Touch
1417
Mouse and touch input allow the user to point at things on the screen. Both input mechanisms report the location of interaction as 2D coordinates relative to the upper left corner of the screen, with the positive x-axis pointing to the right and the y-axis pointing downward.
1518

wiki/input/on-screen-keyboard.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)