Key press function to register both lower and upper case and special characters

3 vues (au cours des 30 derniers jours)
I have a window key press function in app designer. I used key = key.event to get the character that is pressed on the key board. However, when I tried to type upper case letters by holding shift, or type while having the capslock on, the key press function gives me key equal to ‘shift’, key=‘the lower case letter I pressed’, key =‘capslock’ etc. I cannot type upper case letters. I am wondering how can I achieve it. I will really appreciate your help.

Réponses (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi le 22 Jan 2020
Hi Kaiser,
According to the documentation of ‘WindowKeyPressFcn’, ‘Key’ returned is identified by the (lowercase) label on the key and keys like ‘shift’ , ‘alt’ are stored in ‘Modifier’ property of KeyData object. So you could not recognize capital letters directly. But you could use the ‘Modifier’ property to detect the Capital letters.
For more information you can refer to the following link

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by