Skip to content

Commit

Permalink
Adding new virtual keyboard maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanceewing committed Mar 13, 2024
1 parent 2ea4302 commit 1011dac
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ public GameScreenInputProcessor(GameScreen gameScreen, DialogHandler dialogHandl
* @return whether the input was processed
*/
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
System.out.println("touchDown: screenX=" + screenX + ", screenY=" + screenY);

// Convert the screen coordinates to world coordinates.
Vector2 touchXY = viewportManager.unproject(screenX, screenY);

Expand Down Expand Up @@ -198,8 +196,6 @@ private void updateAGIMouse(Vector2 touchXY, int button, boolean buttonDown) {
* @return whether the input was processed
*/
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
System.out.println("touchUp: screenX=" + screenX + ", screenY=" + screenY);

// Convert the screen coordinates to world coordinates.
Vector2 touchXY = viewportManager.unproject(screenX, screenY);

Expand Down Expand Up @@ -289,7 +285,7 @@ public boolean touchUp(int screenX, int screenY, int pointer, int button) {

if (keyboardClicked) {
if (keyboardType.equals(KeyboardType.OFF)) {
keyboardType = (viewportManager.isPortrait() ? KeyboardType.PORTRAIT : KeyboardType.LANDSCAPE);
keyboardType = (viewportManager.isPortrait() ? KeyboardType.PORTRAIT_LOWER_CASE : KeyboardType.LANDSCAPE_LOWER_CASE);
viewportManager.update();
} else {
keyboardType = KeyboardType.OFF;
Expand Down Expand Up @@ -356,8 +352,6 @@ public boolean mouseMoved (int screenX, int screenY) {
* @return whether the input was processed
*/
public boolean touchDragged(int screenX, int screenY, int pointer) {
System.out.println("touchDragged: screenX=" + screenX + ", screenY=" + screenY);

// Convert the screen coordinates to world coordinates.
Vector2 touchXY = viewportManager.unproject(screenX, screenY);

Expand Down Expand Up @@ -403,7 +397,7 @@ public boolean touchDragged(int screenX, int screenY, int pointer) {
public void resize(int width, int height) {
if (keyboardType.isRendered()) {
// Switch keyboard layout based on the orientation.
keyboardType = (height > width ? KeyboardType.PORTRAIT : KeyboardType.LANDSCAPE);
keyboardType = (height > width ? KeyboardType.PORTRAIT_LOWER_CASE : KeyboardType.LANDSCAPE_LOWER_CASE);
}
}

Expand Down
Loading

0 comments on commit 1011dac

Please sign in to comment.