This companion object of type CompassDir
provides a selection of related
constants and utility methods.
This object has an alias in the top-level package o1, so it’s accessible to students
simply via import o1.*
.
- Companion:
- class
Type members
Inherited types
Value members
Concrete methods
Returns the CompassDir that corresponds to the given arrow key.
For example, the right arrow corresponds to East
.
Returns the CompassDir that corresponds to the given arrow key.
For example, the right arrow corresponds to East
.
- Value parameters:
- key
any key on the keyboard
- Returns:
one of the four
CompassDir
s;None
if the given key is not one of the four arrow keys- See also:
Returns the CompassDir that corresponds to the given arrow key.
For example, the right arrow or the D key corresponds to East
.
Returns the CompassDir that corresponds to the given arrow key.
For example, the right arrow or the D key corresponds to East
.
- Value parameters:
- key
any key on the keyboard
- Returns:
one of the four
CompassDir
s;None
if the given key is not one of the four arrow keys or one of the four WASD keys- See also:
Returns the CompassDir that corresponds to the given WASD key.
For example, the D key corresponds to East
.
Returns the CompassDir that corresponds to the given WASD key.
For example, the D key corresponds to East
.
- Value parameters:
- key
any key on the keyboard
- Returns:
one of the four
CompassDir
s;None
if the given key is not one of the four WASD keys- See also: