Message-ID: <4C23A154.4030601@waddell.ch>
Date: 2010-06-24T18:17:56Z
From: Adrian Waddell
Subject: [R-gui] Ask for the State of a Keyboard Key
Dear GUI list,
Is it possible in R to check whether a certain key is pressed or not.
For example
if(isKeyPressed("a")) {
cat("a is pressed\n")
}else {
cat("a is not pressed\n")
}
I would like to use this function within tk events. For example when a
'<Button-1>' event calls foo(), I would like to know within foo()
whether the Shift key is pressed or not.
I know that I could generate events when a key is pressed or released
(with focus on a tk toplevel window). However I would prefer a function
like isKeyPressed().
Sincerely,
Adrian Waddell