开发者

C# Keyboard mappings

开发者 https://www.devze.com 2023-03-26 12:23 出处:网络
I am trying to create an on screen keyboard in WPF, however I\'ve gotten stuck on a programatic way to map the non-开发者_JS百科alpha keys to their shifted equivalent, for example:

I am trying to create an on screen keyboard in WPF, however I've gotten stuck on a programatic way to map the non-开发者_JS百科alpha keys to their shifted equivalent, for example:

1 becomes ! 2 becomes " 3 becomes £

etc, for if possible, the current culture, or if not the UK Layout.

Any help would be appreciated, thank you!


You need to interrogate the keyboard map as described in this answer.

This way you can get the charachter for all modifiers on your current map or another map.

The post describes how to use the ToAscii WinAPI, you can use the results to "modify" the display of your keyboard. Use ToAsciiEx for other keyboard maps.

This doesen't help you with what I think is a rather more difficult problem of how to layout the keyboard, touched on by this wikipedia article.

However, if you are going for a standardised tablet friendly approach you have probably dealt with this and, in fact, the localization of the user may be irrelavent.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号