Key press function to register both lower and upper case and special characters
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Sahithi Kanumarlapudi
2020-1-22
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 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!