不同语言之间的密钥转换 [英] Key converting between different languages

查看:83
本文介绍了不同语言之间的密钥转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不同语言之间获取键盘键?例如。 quwerty键盘上的(A)键等于另一个键盘上的(某些字母)。我怎样才能获得该密钥。

How can I get the keyboard key between different languages? E.g. the (A) key at quwerty keyboard equals (some letter) in another keyboard. How can I get that key.

推荐答案

没有这样的翻译。在许多语言中,a键不存在,并且没有翻译成另一种语言。你的问题没有任何意义。地狱,不同的键盘甚至可能没有相同数量的键!
There is no such translation. In many languages, the 'a' key doesn't exist and there is no translation to another language. Your question doesn't make any sense. Hell, different keyboards may not even have the same number of keys!


WPF会自己管理它,.NET将通过系统检查键盘的键排列,WPF将从中获取该信息。 NET。



A的代码为65,它的代码为AZERTY和QWERTY。不要打扰确定。代码类似。尽管WPF提供了一种更好的方法来确定密钥的代码,但使用 密钥 [ ^ ]枚举。然后你可以确定它是哪个键,



WPF would manage it itself, .NET would check for the keyboard's key arrangement through system and WPF would get that information from .NET.

A has a code of 65, it would have same code of AZERTY and on QWERTY. Do not bother determining that. The code is similar. Even though WPF provides a better way to determine the codes for keys, using the Key[^] enumeration. You can then determine which key it was,

if(e.Key == Key.A) {
   // A was pressed
}



或者甚至像这样,


Or even like this,

if(Keyboard.IsKeyDown(Key.A)) {
   // Good thing, you can make it a complex statement, to check other key states too.
}



然后你可以得到你想要的东西。让WPF为您处理一切,只需使用此枚举并使用A键。



从WPF中的键盘键获取值 - 堆栈溢出 [ ^ ]


这篇关于不同语言之间的密钥转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆