about summary refs log tree commit diff
path: root/Completion/X/_x_keysym
blob: 6b031014afd5460a2e44c92d2075f61af04c57f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#autoload

local expl

if (( ! $+_keysym_cache )); then
  local file

  file=( /usr/{include,{{X11R6,openwin},local{,/X11{,R6}}}/include}/X11/keysymdef.h(N) )

  if (( $#file )); then
    _keysym_cache=( "${(@)${(@)${(M@)${(@f)$(< $file[1])}:#\#define[ 	]##XK_*}#\#define[ 	]##XK_}%%[ 	]*}" )
  else
    _keysym_cache=( BackSpace Tab Linefeed Clear Return Pause Escape 
                    Delete Left Right Up Down Space Home Begin End
		    F{1,2,3,4,5,6,7,8,9,10,11,12} )
  fi
fi

_description expl 'key symbol'
compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - $_keysym_cache