Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # toggle-able safe mode movement
- ###
- # binding keypad keycodes to hjkl keys
- macros += M \{-252} h
- macros += M \{-249} y
- macros += M \{-254} k
- macros += M \{-246} u
- macros += M \{-251} l
- macros += M \{-245} n
- macros += M \{-253} j
- macros += M \{-248} b
- : function startsafemode()
- : safemodeon = true
- : crawl.mpr("Safe mode on.")
- bindkey = [b] CMD_SAFE_MOVE_DOWN_LEFT
- bindkey = [h] CMD_SAFE_MOVE_LEFT
- bindkey = [j] CMD_SAFE_MOVE_DOWN
- bindkey = [k] CMD_SAFE_MOVE_UP
- bindkey = [l] CMD_SAFE_MOVE_RIGHT
- bindkey = [n] CMD_SAFE_MOVE_DOWN_RIGHT
- bindkey = [u] CMD_SAFE_MOVE_UP_RIGHT
- bindkey = [y] CMD_SAFE_MOVE_UP_LEFT
- : end
- : function stopsafemode()
- : safemodeon = false
- : crawl.mpr("Safe mode off.")
- bindkey = [b] CMD_MOVE_DOWN_LEFT
- bindkey = [h] CMD_MOVE_LEFT
- bindkey = [j] CMD_MOVE_DOWN
- bindkey = [k] CMD_MOVE_UP
- bindkey = [l] CMD_MOVE_RIGHT
- bindkey = [n] CMD_MOVE_DOWN_RIGHT
- bindkey = [u] CMD_MOVE_UP_RIGHT
- bindkey = [y] CMD_MOVE_UP_LEFT
- : end
- # initialize off
- : stopsafemode()
- : function togglesafe()
- : if safemodeon then
- : stopsafemode()
- : else
- : startsafemode()
- : end
- : end
- macros += M ] ===togglesafe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement