MATLAB Answers

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

2 views (last 30 days)
Kaiser Okyan
Kaiser Okyan on 5 Dec 2019
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.

  0 Comments

Sign in to comment.

Answers (1)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi on 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

  0 Comments

Sign in to comment.