mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
elinkskeys(5): Improve the listing of actions and default keybindings
Display them in a table for the HTML version.
This commit is contained in:
parent
279f33e985
commit
c517dbf101
@ -52,6 +52,15 @@ print_keymap_actions()
|
|||||||
{
|
{
|
||||||
keymap=$1
|
keymap=$1
|
||||||
|
|
||||||
|
case "$DOCTYPE" in
|
||||||
|
html)
|
||||||
|
# open-link-in-new-tab-in-background
|
||||||
|
echo '`----------------------------------`----------------------------------------------------------------------------'
|
||||||
|
echo 'Action Description'
|
||||||
|
echo '----------------------------------------------------------------------------------------------------------------'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
grep ACTION_ "$CONFIGDIR/actions-$keymap.inc" \
|
grep ACTION_ "$CONFIGDIR/actions-$keymap.inc" \
|
||||||
| while read entry;
|
| while read entry;
|
||||||
do
|
do
|
||||||
@ -61,10 +70,23 @@ print_keymap_actions()
|
|||||||
[ "$action" = "none" ] && continue
|
[ "$action" = "none" ] && continue
|
||||||
[ "$action" = " *scripting-function*" ] && continue
|
[ "$action" = " *scripting-function*" ] && continue
|
||||||
|
|
||||||
echo
|
case "$DOCTYPE" in
|
||||||
echo "$action::"
|
man)
|
||||||
echo " $caption."
|
echo
|
||||||
|
echo "$action::"
|
||||||
|
echo " $caption."
|
||||||
|
;;
|
||||||
|
html)
|
||||||
|
printf "%-34s %s\n" "$action" "$caption"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
case "$DOCTYPE" in
|
||||||
|
html)
|
||||||
|
echo '---------------------------------------------------------------------------------------------------------------'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
print_keymap_defaults()
|
print_keymap_defaults()
|
||||||
@ -72,6 +94,15 @@ print_keymap_defaults()
|
|||||||
keymap="$1"
|
keymap="$1"
|
||||||
KEYMAP=$(echo $1 | tr '[a-z]' '[A-Z]')
|
KEYMAP=$(echo $1 | tr '[a-z]' '[A-Z]')
|
||||||
|
|
||||||
|
case "$DOCTYPE" in
|
||||||
|
html)
|
||||||
|
# Ctrl-Insert
|
||||||
|
echo '`-----------`-------------------------------------------------------------------------------'
|
||||||
|
echo 'Key Description (Action)'
|
||||||
|
echo '--------------------------------------------------------------------------------------------'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
grep ACT_$KEYMAP $KBDBIND | grep '^[[:space:]]{' | grep -v '{ "' \
|
grep ACT_$KEYMAP $KBDBIND | grep '^[[:space:]]{' | grep -v '{ "' \
|
||||||
| while read entry
|
| while read entry
|
||||||
do
|
do
|
||||||
@ -103,10 +134,23 @@ print_keymap_defaults()
|
|||||||
*) modifier="" ;;
|
*) modifier="" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo
|
case "$DOCTYPE" in
|
||||||
echo "'$modifier$key'::"
|
man)
|
||||||
echo " $action"
|
echo
|
||||||
|
echo "'$modifier$key'::"
|
||||||
|
echo " $action"
|
||||||
|
;;
|
||||||
|
html)
|
||||||
|
printf "%-11s %s\n" "$modifier$key" "$action"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
case "$DOCTYPE" in
|
||||||
|
html)
|
||||||
|
echo '--------------------------------------------------------------------------------------------'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
cat << __END__
|
cat << __END__
|
||||||
|
Loading…
Reference in New Issue
Block a user