xte -d

There is an undocumented xte flag: xte -d X, where X value above 2 will throw additional debug information. My use for it was to find a proper keycode for X86* keys.

Another way to search for keycodes is here:

cat /usr/include/X11/XF86keysym.h

Part of the output:

...
DEBUG 2) keycode=98 + mod=2 => Katakana (keysym 65318)
DEBUG 2) keycode=99 + mod=0 => Hiragana (keysym 65317)
DEBUG 2) keycode=99 + mod=2 => Hiragana (keysym 65317)
DEBUG 2) keycode=100 + mod=0 => Henkan_Mode (keysym 65315)
DEBUG 2) keycode=100 + mod=2 => Henkan_Mode (keysym 65315)
DEBUG 2) keycode=101 + mod=0 => Hiragana_Katakana (keysym 65319)
DEBUG 2) keycode=101 + mod=2 => Hiragana_Katakana (keysym 65319)
...
DEBUG 2) keycode=121 + mod=0 => XF86AudioMute (keysym 269025042)
DEBUG 2) keycode=121 + mod=2 => XF86AudioMute (keysym 269025042)
DEBUG 2) keycode=122 + mod=0 => XF86AudioLowerVolume (keysym 269025041)
DEBUG 2) keycode=122 + mod=2 => XF86AudioLowerVolume (keysym 269025041)
DEBUG 2) keycode=123 + mod=0 => XF86AudioRaiseVolume (keysym 269025043)
DEBUG 2) keycode=123 + mod=2 => XF86AudioRaiseVolume (keysym 269025043)
DEBUG 2) keycode=124 + mod=0 => XF86PowerOff (keysym 269025066)
DEBUG 2) keycode=124 + mod=2 => XF86PowerOff (keysym 269025066)
...
DEBUG 2) keycode=147 + mod=0 => XF86MenuKB (keysym 269025125)
DEBUG 2) keycode=147 + mod=2 => XF86MenuKB (keysym 269025125)
DEBUG 2) keycode=148 + mod=0 => XF86Calculator (keysym 269025053)
DEBUG 2) keycode=148 + mod=2 => XF86Calculator (keysym 269025053)
DEBUG 2) keycode=150 + mod=0 => XF86Sleep (keysym 269025071)
DEBUG 2) keycode=150 + mod=2 => XF86Sleep (keysym 269025071)
DEBUG 2) keycode=151 + mod=0 => XF86WakeUp (keysym 269025067)
DEBUG 2) keycode=151 + mod=2 => XF86WakeUp (keysym 269025067)
DEBUG 2) keycode=152 + mod=0 => XF86Explorer (keysym 269025117)
DEBUG 2) keycode=152 + mod=2 => XF86Explorer (keysym 269025117)
DEBUG 2) keycode=153 + mod=0 => XF86Send (keysym 269025147)
DEBUG 2) keycode=153 + mod=2 => XF86Send (keysym 269025147)
DEBUG 2) keycode=155 + mod=0 => XF86Xfer (keysym 269025162)
DEBUG 2) keycode=155 + mod=2 => XF86Xfer (keysym 269025162)
DEBUG 2) keycode=156 + mod=0 => XF86Launch1 (keysym 269025089)
DEBUG 2) keycode=156 + mod=2 => XF86Launch1 (keysym 269025089)
DEBUG 2) keycode=157 + mod=0 => XF86Launch2 (keysym 269025090)
DEBUG 2) keycode=157 + mod=2 => XF86Launch2 (keysym 269025090)
DEBUG 2) keycode=158 + mod=0 => XF86WWW (keysym 269025070)
DEBUG 2) keycode=158 + mod=2 => XF86WWW (keysym 269025070)
DEBUG 2) keycode=159 + mod=0 => XF86DOS (keysym 269025114)
DEBUG 2) keycode=159 + mod=2 => XF86DOS (keysym 269025114)
DEBUG 2) keycode=160 + mod=0 => XF86ScreenSaver (keysym 269025069)
DEBUG 2) keycode=160 + mod=2 => XF86ScreenSaver (keysym 269025069)
DEBUG 2) keycode=161 + mod=0 => XF86RotateWindows (keysym 269025140)
DEBUG 2) keycode=161 + mod=2 => XF86RotateWindows (keysym 269025140)
DEBUG 2) keycode=162 + mod=0 => XF86TaskPane (keysym 269025151)
DEBUG 2) keycode=162 + mod=2 => XF86TaskPane (keysym 269025151)
DEBUG 2) keycode=163 + mod=0 => XF86Mail (keysym 269025049)
DEBUG 2) keycode=163 + mod=2 => XF86Mail (keysym 269025049)
DEBUG 2) keycode=164 + mod=0 => XF86Favorites (keysym 269025072)
DEBUG 2) keycode=164 + mod=2 => XF86Favorites (keysym 269025072)
DEBUG 2) keycode=165 + mod=0 => XF86MyComputer (keysym 269025075)
DEBUG 2) keycode=165 + mod=2 => XF86MyComputer (keysym 269025075)
DEBUG 2) keycode=166 + mod=0 => XF86Back (keysym 269025062)
DEBUG 2) keycode=166 + mod=2 => XF86Back (keysym 269025062)
DEBUG 2) keycode=167 + mod=0 => XF86Forward (keysym 269025063)
DEBUG 2) keycode=167 + mod=2 => XF86Forward (keysym 269025063)
DEBUG 2) keycode=169 + mod=0 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=169 + mod=2 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=170 + mod=0 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=170 + mod=2 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=171 + mod=0 => XF86AudioNext (keysym 269025047)
DEBUG 2) keycode=171 + mod=2 => XF86AudioNext (keysym 269025047)
DEBUG 2) keycode=172 + mod=0 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=172 + mod=1 => XF86AudioPause (keysym 269025073)
DEBUG 2) keycode=172 + mod=2 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=172 + mod=3 => XF86AudioPause (keysym 269025073)
DEBUG 2) keycode=173 + mod=0 => XF86AudioPrev (keysym 269025046)
DEBUG 2) keycode=173 + mod=2 => XF86AudioPrev (keysym 269025046)
DEBUG 2) keycode=174 + mod=0 => XF86AudioStop (keysym 269025045)
DEBUG 2) keycode=174 + mod=1 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=174 + mod=2 => XF86AudioStop (keysym 269025045)
DEBUG 2) keycode=174 + mod=3 => XF86Eject (keysym 269025068)
DEBUG 2) keycode=175 + mod=0 => XF86AudioRecord (keysym 269025052)
DEBUG 2) keycode=175 + mod=2 => XF86AudioRecord (keysym 269025052)
DEBUG 2) keycode=176 + mod=0 => XF86AudioRewind (keysym 269025086)
DEBUG 2) keycode=176 + mod=2 => XF86AudioRewind (keysym 269025086)
DEBUG 2) keycode=177 + mod=0 => XF86Phone (keysym 269025134)
DEBUG 2) keycode=177 + mod=2 => XF86Phone (keysym 269025134)
DEBUG 2) keycode=179 + mod=0 => XF86Tools (keysym 269025153)
DEBUG 2) keycode=179 + mod=2 => XF86Tools (keysym 269025153)
DEBUG 2) keycode=180 + mod=0 => XF86HomePage (keysym 269025048)
DEBUG 2) keycode=180 + mod=2 => XF86HomePage (keysym 269025048)
DEBUG 2) keycode=181 + mod=0 => XF86Reload (keysym 269025139)
DEBUG 2) keycode=181 + mod=2 => XF86Reload (keysym 269025139)
DEBUG 2) keycode=182 + mod=0 => XF86Close (keysym 269025110)
DEBUG 2) keycode=182 + mod=2 => XF86Close (keysym 269025110)
DEBUG 2) keycode=185 + mod=0 => XF86ScrollUp (keysym 269025144)
DEBUG 2) keycode=185 + mod=2 => XF86ScrollUp (keysym 269025144)
DEBUG 2) keycode=186 + mod=0 => XF86ScrollDown (keysym 269025145)
DEBUG 2) keycode=186 + mod=2 => XF86ScrollDown (keysym 269025145)
...
DEBUG 2) keycode=192 + mod=0 => XF86Launch5 (keysym 269025093)
DEBUG 2) keycode=192 + mod=2 => XF86Launch5 (keysym 269025093)
DEBUG 2) keycode=193 + mod=0 => XF86Launch6 (keysym 269025094)
DEBUG 2) keycode=193 + mod=2 => XF86Launch6 (keysym 269025094)
DEBUG 2) keycode=194 + mod=0 => XF86Launch7 (keysym 269025095)
DEBUG 2) keycode=194 + mod=2 => XF86Launch7 (keysym 269025095)
DEBUG 2) keycode=195 + mod=0 => XF86Launch8 (keysym 269025096)
DEBUG 2) keycode=195 + mod=2 => XF86Launch8 (keysym 269025096)
DEBUG 2) keycode=196 + mod=0 => XF86Launch9 (keysym 269025097)
DEBUG 2) keycode=196 + mod=2 => XF86Launch9 (keysym 269025097)
DEBUG 2) keycode=198 + mod=0 => XF86AudioMicMute (keysym 269025202)
DEBUG 2) keycode=198 + mod=2 => XF86AudioMicMute (keysym 269025202)
DEBUG 2) keycode=199 + mod=0 => XF86TouchpadToggle (keysym 269025193)
DEBUG 2) keycode=199 + mod=2 => XF86TouchpadToggle (keysym 269025193)
DEBUG 2) keycode=200 + mod=0 => XF86TouchpadOn (keysym 269025200)
DEBUG 2) keycode=200 + mod=2 => XF86TouchpadOn (keysym 269025200)
DEBUG 2) keycode=201 + mod=0 => XF86TouchpadOff (keysym 269025201)
DEBUG 2) keycode=201 + mod=2 => XF86TouchpadOff (keysym 269025201)
DEBUG 2) keycode=203 + mod=0 => ISO_Level5_Shift (keysym 65041)
DEBUG 2) keycode=203 + mod=2 => ISO_Level5_Shift (keysym 65041)
...
DEBUG 2) keycode=208 + mod=0 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=208 + mod=2 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=209 + mod=0 => XF86AudioPause (keysym 269025073)
DEBUG 2) keycode=209 + mod=2 => XF86AudioPause (keysym 269025073)
DEBUG 2) keycode=210 + mod=0 => XF86Launch3 (keysym 269025091)
DEBUG 2) keycode=210 + mod=2 => XF86Launch3 (keysym 269025091)
DEBUG 2) keycode=211 + mod=0 => XF86Launch4 (keysym 269025092)
DEBUG 2) keycode=211 + mod=2 => XF86Launch4 (keysym 269025092)
DEBUG 2) keycode=212 + mod=0 => XF86LaunchB (keysym 269025099)
DEBUG 2) keycode=212 + mod=2 => XF86LaunchB (keysym 269025099)
DEBUG 2) keycode=213 + mod=0 => XF86Suspend (keysym 269025191)
DEBUG 2) keycode=213 + mod=2 => XF86Suspend (keysym 269025191)
DEBUG 2) keycode=214 + mod=0 => XF86Close (keysym 269025110)
DEBUG 2) keycode=214 + mod=2 => XF86Close (keysym 269025110)
DEBUG 2) keycode=215 + mod=0 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=215 + mod=2 => XF86AudioPlay (keysym 269025044)
DEBUG 2) keycode=216 + mod=0 => XF86AudioForward (keysym 269025175)
DEBUG 2) keycode=216 + mod=2 => XF86AudioForward (keysym 269025175)
DEBUG 2) keycode=218 + mod=0 => Print (keysym 65377)
DEBUG 2) keycode=218 + mod=2 => Print (keysym 65377)
DEBUG 2) keycode=220 + mod=0 => XF86WebCam (keysym 269025167)
DEBUG 2) keycode=220 + mod=2 => XF86WebCam (keysym 269025167)
DEBUG 2) keycode=221 + mod=0 => XF86AudioPreset (keysym 269025206)
DEBUG 2) keycode=221 + mod=2 => XF86AudioPreset (keysym 269025206)
DEBUG 2) keycode=223 + mod=0 => XF86Mail (keysym 269025049)
DEBUG 2) keycode=223 + mod=2 => XF86Mail (keysym 269025049)
DEBUG 2) keycode=224 + mod=0 => XF86Messenger (keysym 269025166)
DEBUG 2) keycode=224 + mod=2 => XF86Messenger (keysym 269025166)
DEBUG 2) keycode=225 + mod=0 => XF86Search (keysym 269025051)
DEBUG 2) keycode=225 + mod=2 => XF86Search (keysym 269025051)
DEBUG 2) keycode=226 + mod=0 => XF86Go (keysym 269025119)
DEBUG 2) keycode=226 + mod=2 => XF86Go (keysym 269025119)
DEBUG 2) keycode=227 + mod=0 => XF86Finance (keysym 269025084)
DEBUG 2) keycode=227 + mod=2 => XF86Finance (keysym 269025084)
DEBUG 2) keycode=228 + mod=0 => XF86Game (keysym 269025118)
DEBUG 2) keycode=228 + mod=2 => XF86Game (keysym 269025118)
DEBUG 2) keycode=229 + mod=0 => XF86Shop (keysym 269025078)
DEBUG 2) keycode=229 + mod=2 => XF86Shop (keysym 269025078)
DEBUG 2) keycode=231 + mod=0 => Cancel (keysym 65385)
DEBUG 2) keycode=231 + mod=2 => Cancel (keysym 65385)
DEBUG 2) keycode=232 + mod=0 => XF86MonBrightnessDown (keysym 269025027)
DEBUG 2) keycode=232 + mod=2 => XF86MonBrightnessDown (keysym 269025027)
DEBUG 2) keycode=233 + mod=0 => XF86MonBrightnessUp (keysym 269025026)
DEBUG 2) keycode=233 + mod=2 => XF86MonBrightnessUp (keysym 269025026)
DEBUG 2) keycode=234 + mod=0 => XF86AudioMedia (keysym 269025074)
DEBUG 2) keycode=234 + mod=2 => XF86AudioMedia (keysym 269025074)
DEBUG 2) keycode=235 + mod=0 => XF86Display (keysym 269025113)
DEBUG 2) keycode=235 + mod=2 => XF86Display (keysym 269025113)
DEBUG 2) keycode=236 + mod=0 => XF86KbdLightOnOff (keysym 269025028)
DEBUG 2) keycode=236 + mod=2 => XF86KbdLightOnOff (keysym 269025028)
DEBUG 2) keycode=237 + mod=0 => XF86KbdBrightnessDown (keysym 269025030)
DEBUG 2) keycode=237 + mod=2 => XF86KbdBrightnessDown (keysym 269025030)
DEBUG 2) keycode=238 + mod=0 => XF86KbdBrightnessUp (keysym 269025029)
DEBUG 2) keycode=238 + mod=2 => XF86KbdBrightnessUp (keysym 269025029)
...
DEBUG 2) keycode=245 + mod=0 => XF86Bluetooth (keysym 269025172)
DEBUG 2) keycode=245 + mod=2 => XF86Bluetooth (keysym 269025172)
DEBUG 2) keycode=246 + mod=0 => XF86WLAN (keysym 269025173)
DEBUG 2) keycode=246 + mod=2 => XF86WLAN (keysym 269025173)
DEBUG 2) keycode=247 + mod=0 => XF86UWB (keysym 269025174)
DEBUG 2) keycode=247 + mod=2 => XF86UWB (keysym 269025174)
DEBUG 2) keycode=249 + mod=0 => XF86Next_VMode (keysym 269024802)
DEBUG 2) keycode=249 + mod=2 => XF86Next_VMode (keysym 269024802)
DEBUG 2) keycode=250 + mod=0 => XF86Prev_VMode (keysym 269024803)
DEBUG 2) keycode=250 + mod=2 => XF86Prev_VMode (keysym 269024803)
DEBUG 2) keycode=251 + mod=0 => XF86MonBrightnessCycle (keysym 269025031)
DEBUG 2) keycode=251 + mod=2 => XF86MonBrightnessCycle (keysym 269025031)
DEBUG 2) keycode=252 + mod=0 => XF86BrightnessAuto (keysym 268964084)
DEBUG 2) keycode=252 + mod=2 => XF86BrightnessAuto (keysym 268964084)
DEBUG 2) keycode=253 + mod=0 => XF86DisplayOff (keysym 268964085)
DEBUG 2) keycode=253 + mod=2 => XF86DisplayOff (keysym 268964085)
DEBUG 2) keycode=254 + mod=0 => XF86WWAN (keysym 269025204)
DEBUG 2) keycode=254 + mod=2 => XF86WWAN (keysym 269025204)
DEBUG 2) keycode=255 + mod=0 => XF86RFKill (keysym 269025205)
DEBUG 2) keycode=255 + mod=2 => XF86RFKill (keysym 269025205)

Have fun!