7
$\begingroup$

EventHandler and {"KeyDown","x"} work for registering a specific letter. Is there a direct way to return whichever letter keys are pressed?

$\endgroup$
  • $\begingroup$ See CurrentValue["EventKey"] $\endgroup$ – b3m2a1 Oct 6 '17 at 3:37
16
$\begingroup$

Perhaps something like this?:

DynamicModule[{key = ""}, 
 EventHandler[
  Dynamic[key],
  {"KeyDown" :> (key = CurrentValue["EventKey"])}
 ]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.