开发者

C# Keyboard mappings

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜