format = 1
best = "kx"
shiftfn = ( 1, 10, 11 )
xterm_mouse = true

maps {
	nokx {
		%_use = "_kx_nokx"
		up = "\e[A"
		left = "\e[D"
		down = "\e[B"
		right = "\e[C"
		kp_center = "\e[G"
		# These are the same as <key>-c, but because the shifted version is more likely
		# to be useful, we declare them as shifted keys.
		up-s = "\eOA"
		left-s = "\eOD"
		down-s = "\eOB"
		right-s = "\eOC"
		kp_center-s = "\eOG"
	}

	kx {
		_enter = "\e[?1h\e="
		_leave = "\e[?1l\e>"
		%_use = "_kx_nokx"
		up = "\eOA"
		left = "\eOD"
		down = "\eOB"
		right = "\eOC"
		kp_div = "\eOQ"
		kp_mul = "\eOR"
		kp_minus = "\eOS"
		kp_home = "\eOw"
		kp_up = "\eOx"
		kp_page_up = "\eOy"
		kp_plus = "\eOl"
		kp_left = "\eOt"
		kp_center = "\eOu"
		kp_right = "\eOv"
		kp_end = "\eOq"
		kp_down = "\eOr"
		kp_page_down = "\eOs"
		kp_insert = "\eOp"
		kp_delete = "\eOn"
		kp_enter = "\eOM"

		# These are the same as <key>-c, but because the shifted version is more likely
		# to be useful, we declare them as shifted keys.
		up-s = "\e[A"
		left-s = "\e[D"
		down-s = "\e[B"
		right-s = "\e[C"
		kp_plus-s = "\eOm"
	}

	_kx_nokx {
		insert = "\e[2~"
		home = "\e[1~"
		page_up = "\e[5~"
		delete = "\e[3~"
		end = "\e[4~"
		page_down = "\e[6~"
		backspace = "\177"
		f1 = "\e[11~"
		f2 = "\e[12~"
		f3 = "\e[13~"
		f4 = "\e[14~"
		f5 = "\e[15~"
		f6 = "\e[17~"
		f7 = "\e[18~"
		f8 = "\e[19~"
		f9 = "\e[20~"
		f10 = "\e[21~"
		f11 = "\e[23~"
		f12 = "\e[24~"
		f13 = "\e[25~"
		f14 = "\e[26~"
		f15 = "\e[28~"
		f16 = "\e[29~"
		f17 = "\e[31~"
		f18 = "\e[32~"
		f19 = "\e[33~"
		f20 = "\e[34~"
		backspace-c = "\010"
		tab-s = "\e[Z"
	}
}
