# File: pref-dos.prf

#
# This file is used by Angband (when it was compiled using "main-ibm.c"
# or "main-dos.c") to specify various "user preferences", including "macros".
#
# This file defines some basic macros, which allow the use of the "keypad",
# alone, and with the shift and/or control modifier keys.  All "special"
# keys are translated by "main-ibm.c" (or "main-dos.c") into special "macro
# triggers" of the encoded form "^_MMMxSS\r", where the "modifier" flags are
# stored in "MMM", and the two digit hexidecimal scan code of the keypress is
# stored in "SS".
#
# The "main-ibm.prf" and "main-dos.prf" files may not be able to recognize
# the "/" and "*" keys on the keypad, because it mistakenly classifies the
# "0x35" and "0x37" codes as the keycodes of "normal" keys.
#
# See "main-ibm.c" and "main-dos.c" for more info.
#


#
# Macro Trigger configuration
#
# T:<trigger template>:<modifiers>:<modifier name1>:<modifier name2>:....
# '&' in <trigger template> specifies location of modifier character.
# '#' in <trigger template> specifies location of key code.
#
# If <trigger template> is null string, all trigger difinition will be cleared.

T:&x#:CSA:control-:shift-:alt-

# T:<trigger name>:<keycode>:<keycode with shiftkey>
# '\' in <trigger name> is escape character.

T:-:0C
T:=:0D
T:[:1A
T:]:1B
T:;:27
T:\':28
T:`:29
T:\\:2B
T:,:33
T:.:34
T:\/:35
T:1:02
T:2:03
T:3:04
T:4:05
T:5:06
T:6:07
T:7:08
T:8:09
T:9:0A
T:0:0B
T:Backspace:0E
T:Q:10
T:W:11
T:E:12
T:R:13
T:T:14
T:Y:15
T:U:16
T:I:17
T:O:18
T:P:19
T:Enter:1C
T:A:1E
T:S:1F
T:D:20
T:F:21
T:G:22
T:H:23
T:J:24
T:K:25
T:L:26
T:Z:2C
T:X:2D
T:C:2E
T:V:2F
T:B:30
T:N:31
T:M:32

# Function keys
T:F1:3B:54
T:F2:3C:55
T:F3:3D:56
T:F4:3E:57
T:F5:3F:58
T:F6:40:59
T:F7:41:5A
T:F8:42:5B
T:F9:43:5C
T:F10:44:5D

T:Home:47
T:Up:48
T:PageUp:49

# Alt-KP_Minus
T:KP_Minus:4A

T:Left:4B
T:Center:4C
T:Right:4D

# Alt-KP_Plus
T:KP_Plus:4E

T:End:4F
T:Down:50
T:Page_Down:51
T:Insert:52
T:Delete:53

# Function keys + Shift
#T:F1:54
#T:F2:55
#T:F3:56
#T:F4:57
#T:F5:58
#T:F6:59
#T:F7:5A
#T:F8:5B
#T:F9:5C
#T:F10:5D

# Function keys + Ctrl
T:F1:5E
T:F2:5F
T:F3:60
T:F4:61
T:F5:62
T:F6:63
T:F7:64
T:F8:65
T:F9:66
T:F10:67

# Function keys + Alt
T:F1:68
T:F2:69
T:F3:6A
T:F4:6B
T:F5:6C
T:F6:6D
T:F7:6E
T:F8:6F
T:F9:70
T:F10:71

# Ctrl + key
T:Left:73
T:Right:74
T:End:75
T:Page_Down:76
T:Home:77

# Ctrl-Page_Up
T:Page_Up:84

# Function keys (F11, F12)
T:F11:85:87
T:F12:86:88

# Function keys (F11, F12) + Ctrl
T:F11:89
T:F12:8A

# Function keys (F11, F12) + Alt
T:F11:8B
T:F12:8C

T:Up:8D

# Ctrl-Minus
T:KP_Minus:8E

# Ctrl-Center
T:Center:8F

# Ctrl-Plus
T:KP_Plus:90

# Ctrl-Down
T:Down:91

# Ctrl-Insert
T:Insert:92

# Ctrl-Delete
T:Delete:93

# Ctrl-Tab
T:Tab:94

# Ctrl-Divide
T:Divide:95

# Ctrl-Multiply
T:Multiply:96

# Alt-Home
T:Home:97

# Alt-Up
T:Up:98

# Alt-Page_Up
T:Page_Up:99

# Alt-Left
T:Left:9B

# Alt-Right
T:Right:9D

# Alt-End
T:End:9F

# Alt-Down
T:Down:A0

# Alt-Page_Down
T:Page_Down:A1

# Alt-Insert
T:Insert:A2

# Alt-Divide
T:Divide:A4

############################################################


#
# Hack -- Some foreign keyboards have a special key on the keyboard, which
# is used to generate the "<", ">", and "|" keys (alone, shifted, alt-ed).
#

A:<
P:^_x56\r

A:>
P:^_Sx56\r

A:|
P:^_Ax56\r


#
# Keypad (/,*,7,8,9,-,4,5,6,+,1,2,3,0,.)
#

A:/
P:^_x35\r

A:*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