【发布时间】:2021-06-02 21:10:34
【问题描述】:
我正在尝试为我的 gnuplot 脚本提供基本的键盘交互。
对于gnuplot 5.4 patchlevel 1,我相信我将MOUSE_CHAR 用作documented,但是使用下面最简单的脚本,无论我按什么键都会出错。
while (1) {
pause mouse keypress
show variable MOUSE_
if (exists("MOUSE_CHAR")) {
if (MOUSE_CHAR == "w") {
print "w"
}
} # <-- line 114
replot
}
输出显示按下了正确的键,例如:
MOUSE_KEY = 119
MOUSE_CHAR = "w"
或
MOUSE_KEY = 114
MOUSE_CHAR = "r"
但在我得到之后立即
"hrtp.gp" line 114: Non-numeric string found where a numeric expression was expected
【问题讨论】:
标签: keyboard gnuplot mouse numeric