Skip to content

Commit

Permalink
support other key dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjlockwood committed Oct 20, 2024
1 parent 547153a commit 57665d3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ private fun TextLabel(
}

private val KeyEvent.direction: Direction?
get() = when (key) {
Key.DirectionUp -> Direction.NORTH
Key.DirectionLeft -> Direction.WEST
Key.DirectionDown -> Direction.SOUTH
Key.DirectionRight -> Direction.EAST
get() = when {
key == Key.DirectionUp || key == Key.W -> Direction.NORTH
key == Key.DirectionLeft || key == Key.A -> Direction.WEST
key == Key.DirectionDown || key == Key.S -> Direction.SOUTH
key == Key.DirectionRight || key == Key.D -> Direction.EAST
else -> null
}

Expand Down

0 comments on commit 57665d3

Please sign in to comment.