Borrar filtros
Borrar filtros

Key press in GUI

17 visualizaciones (últimos 30 días)
tomas
tomas el 11 de Jun. de 2011
Hello, is it possible to detect pressing of modifier keys (Ctrl, Alt, Shift) or Home, Pgdn etc. in GUI? I use command get(gcf,'CurrentCharacter'), but for mentioned keys I get empty variable.
Thank you

Respuesta aceptada

Jan
Jan el 11 de Jun. de 2011
You can catch such keys in the WindowKeypressFcn. This will help you to identify the names of the pressed keys:
FigH = figure
set(FigH, 'WindowKeyPressFcn', @KeyPress)
function KeyPress(Source, EventData)
disp(EventData)
Another idea is to use the (still undocumented?) "CurrentKey" and "CurrentModifier" properties of the FIGURE.
  1 comentario
tomas
tomas el 11 de Jun. de 2011
Diky

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by