# Default key mapping table for Free42 (Android version)
#
# Format: [Ctrl|Alt|Shift|CShift|NumPad]* <Character> : <macro>
# <Character> can be a printable character, or a unicode character code written
# in hexadecimal with a 0x prefix, or an Android keycode name. For example, the
# character 0 (zero) can be written as "0" or "0x30" (without the quotes), the
# two representations being equivalent; and the cursor down key can written as
# DPAD_DOWN, which is KeyEvent.KEYCODE_DPAD_DOWN with the KEYCODE_ part
# removed. You should use keycodes for keys that don't generate printable
# characters.
# <macro> is a sequence of zero or more HP-42S key codes. The key codes must be
# between 1 and 255; codes 1..37 correspond to actual keys on the calculator's
# keyboard, while codes 38..255 can be used to refer to extra keys defined by
# customized skins.
#
# Ctrl, Alt, and Shift refer to the Control, Option, and Shift modifier keys on
# the keyboard.
# CShift refers to the state of the Calculator's Shift annunciator. This
# modifier makes it possible for [CShift] [Key] to activate a different
# keystroke or macro than the unshifted [Key], so you can, for example, make
# CShift SQRT be something other than X^2.
# NumPad indicates keys on the numeric keypad. Note that if a key on the
# numeric keypad does not have a mapping, the corresponding non-NumPad mapping
# will be used instead.
#
# Anything from a "#" until the end of the line is a comment, and is ignored.
# White space (Space, Tab) separates tokens in the key map, but is otherwise
# ignored. Note that this means that if you want to define mappings for "#" or
# white space, you must use Unicode character codes.
#
# NOTE: Key events that translate to a single character in the printable ASCII
# range (32..126) are matched without regard of the state of the Shift key --
# so you don't have to use "Shift A" to match uppercase "A", etc. For other key
# events, shift *is* relevant (e.g. "ENTER" is not the same as "Shift ENTER").

F1              : 1       # menu key 1
Shift F1        : 28 1    # menu key 1, shifted
F2              : 2       # menu key 2
Shift F2        : 28 2    # menu key 2, shifted
F3              : 3       # menu key 3
Shift F3        : 28 3    # menu key 3, shifted
F4              : 4       # menu key 4
Shift F4        : 28 4    # menu key 4, shifted
F5              : 5       # menu key 5
Shift F5        : 28 5    # menu key 5, shifted
F6              : 6       # menu key 6
Shift F6        : 28 6    # menu key 6, shifted
a               : 1       # Sigma+ ("Accumulate")
A               : 28 1    # Sigma-
v               : 2       # 1/X ("inVerse")
V               : 28 2    # Y^X
q               : 3       # sqrt(X) ("sQuare root")
Q               : 28 3    # X^2
o               : 4       # LOG ("lOg, not Ln")
O               : 28 4    # 10^X
l               : 5       # LN ("Ln, not lOg")
L               : 28 5    # E^X
x               : 6       # XEQ
X               : 28 6    # GTO
m               : 7       # STO (m as in memory)
M               : 28 7    # COMPLEX
r               : 8       # RCL
R               : 28 8    # %
d               : 9       # RDN (d as in down)
D               : 28 9    # PI
s               : 10      # SIN
S               : 28 10   # ASIN
c               : 11      # COS
C               : 28 11   # ACOS
t               : 12      # TAN
T               : 28 12   # ATAN
0xa             : 13      # ENTER
Shift 0xa       : 28 13   # ALPHA
w               : 14      # X<>Y ("sWap")
W               : 28 14   # LASTX
n               : 15      # +/- ("Negative")
N               : 28 15   # MODES
e               : 16      # E
E               : 28 16   # DISP
DEL             : 17      # <-
Shift DEL       : 28 17   # CLEAR
DPAD_UP         : 18      # up
Shift DPAD_UP   : 28 18   # BST
7               : 19      # 7
&               : 28 19   # SOLVER
8               : 20      # 8
Alt 8           : 28 20   # Integ f(x) (note: can't use "Shift 8" because that's "*", which we use for "multiply")
9               : 21      # 9
(               : 28 21   # MATRIX
/               : 22      # divide
?               : 28 22   # STAT
DPAD_DOWN       : 23      # down
Shift DPAD_DOWN : 28 23   # SST
4               : 24      # 4
$               : 28 24   # BASE
5               : 25      # 5
%               : 28 25   # CONVERT
6               : 26      # 6
^               : 28 26   # FLAGS
*               : 27      # multiply
Ctrl 8          : 28 27   # PROB ("*" is already shifted so we have to do something odd here)
1               : 29      # 1
!               : 28 29   # ASSIGN
2               : 30      # 2
@               : 28 30   # CUSTOM
3               : 31      # 3
0x23            : 28 31   # PGM.FCN
-               : 32      # -
_               : 28 32   # PRINT
ESCAPE          : 33      # EXIT
Shift ESCAPE    : 28 33   # OFF
0               : 34      # 0
)               : 28 34   # TOP.FCN
.               : 35      # .
,               : 35      # .
>               : 28 35   # SHOW
<               : 28 35   # SHOW
\               : 36      # R/S
|               : 28 36   # PRGM
+               : 37      # +
=               : 28 37   # CATALOG ("+" is already shifted so we have to do something odd here)

# Convenience key codes for GTO and PI
g               : 28 6    # GTO
p               : 28 9    # PI
