#
# PWM keybindings
#

# Bind global operations to Mod1+key
set_mod "Mod1"
kbind "Tab", "circulateraise", 1
kbind "Shift+Tab", "circulateraise", -1
kbind "1", "switch_ws_num", 0
kbind "2", "switch_ws_num", 1
kbind "3", "switch_ws_num", 2
kbind "4", "switch_ws_num", 3
kbind "5", "switch_ws_num", 4
kbind "6", "switch_ws_num", 5
kbind "7", "switch_ws_num", 6
kbind "8", "switch_ws_num", 7
kbind "9", "switch_ws_num", 8
kbind "0", "switch_ws_num", 9
kbind "M", "menu", "root_menu"
kbind "G", "menu", "goto_menu"
kbind "D", "menu", "detach_menu"
kbind "T", "toggle_dock"
kbind "E", "exec", "xterm"
kbind "Return", "kb_moveres" # should be Control+Shift but I like this better
#kbind "J", "join_tagged"

# Bind (most) operations affecting the current frame or window to
# Control+Shift+key
#
# This combination may be a little clumsy unless you have control where it
# was supposed to be - left of the letter 'a'. This is where caps lock is
# on most keyboards. It can be remapped to control by adding the following
# lines to your ~/.Xmodmap:
# 	remove Lock = Caps_Lock
# 	add Control = Caps_Lock
# On some X servers/hardware this does not work - the caps lock key becomes
# a *locking* (!) control. Configurability < /dev/zero, say.
#

set_mod "Control+Shift"
kbind "W", "close"
kbind "X", "kill"
kbind "S", "toggle_shade"
kbind "Z", "toggle_stick"
kbind "V", "toggle_maximize", 1
kbind "H", "toggle_maximize", 2
kbind "M", "toggle_maximize", 3
kbind "R", "raise"
kbind "L", "lower"
kbind "A", "menu", "attach_menu"
kbind "O", "menu", "frame_cwin_menu"
#kbind "T", "toggle_tagged"
#kbind "A", "attach_tagged"

kbind "N", "switch_rot", 1
kbind "P", "switch_rot", -1
kbind "1", "switch_nth", 0
kbind "2", "switch_nth", 1
kbind "3", "switch_nth", 2
kbind "4", "switch_nth", 3
kbind "5", "switch_nth", 4
kbind "6", "switch_nth", 5
kbind "7", "switch_nth", 6
kbind "8", "switch_nth", 7
kbind "9", "switch_nth", 8
kbind "0", "switch_nth", 9

# Menu navigation
set_mod ""
kbind_menu "Down", "menu_next"
kbind_menu "n", "menu_next"
kbind_menu "Up", "menu_prev"
kbind_menu "p", "menu_prev"
kbind_menu "Right", "menu_entersub"
kbind_menu "space", "menu_entersub"
kbind_menu "Left", "menu_leavesub"
kbind_menu "b", "menu_leavesub"
kbind_menu "Return", "menu_execute"
kbind_menu "Escape", "menu_close"
kbind_menu "Z", "menu_keep"


# Keyboard move and resize
set_mod ""
kbind_moveres "Escape","kb_moveres_cancel"
kbind_moveres "Return","kb_moveres_end"

set_mod ""
kbind_moveres "Right", "kb_move_stepped", 0x01
kbind_moveres "Left",  "kb_move_stepped", 0x02
kbind_moveres "Down",  "kb_move_stepped", 0x10
kbind_moveres "Up",    "kb_move_stepped", 0x20
set_mod "Mod1"
kbind_moveres "Right", "kb_resize_stepped", 0x01
kbind_moveres "Left",  "kb_resize_stepped", 0x05
kbind_moveres "Down",  "kb_resize_stepped", 0x10
kbind_moveres "Up",    "kb_resize_stepped", 0x50

set_mod "Shift"
kbind_moveres "Right", "kb_move", 0x01
kbind_moveres "Left",  "kb_move", 0x02
kbind_moveres "Down",  "kb_move", 0x10
kbind_moveres "Up",    "kb_move", 0x20
set_mod "Mod1+Shift"
kbind_moveres "Right", "kb_resize", 0x01
kbind_moveres "Left",  "kb_resize", 0x05
kbind_moveres "Down",  "kb_resize", 0x10
kbind_moveres "Up",    "kb_resize", 0x50

set_mod ""
