📄 dd-keypress.sh
字号:
#!/bin/bash# dd-keypress.sh: Capture keystrokes without needing to press ENTER.keypresses=4 # Number of keypresses to capture.old_tty_setting=$(stty -g) # Save old terminal settings.echo "Press $keypresses keys."stty -icanon -echo # Disable canonical mode. # Disable local echo.keys=$(dd bs=1 count=$keypresses 2> /dev/null)# 'dd' uses stdin, if "if" (input file) not specified.stty "$old_tty_setting" # Restore old terminal settings.echo "You pressed the \"$keys\" keys."# Thanks, Stephane Chazelas, for showing the way.exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -