本文介绍了从alt代码获取字符(无键盘事件)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要列出所有来自alt代码的字符。 (如果你不知道什么是不知道是什么,按住ALT,然后按数字键盘上的一个,然后重复,并点击2,等等。)有没有办法,而不使用键事件?我真正要做的是这样的;

I need to list all of the characters from alt codes. (If you somehow don't know what that is, hold down ALT and press one on the number pad, then repeat and hit 2, etc.) Is there a way to do this without using key events? What exactly I'm going to do is something like this;

for (int i = 0; i < 10; i++) {
    Console.Write(KeyCode(i)); //Obviously KeyCode() doesnt actually exist, thats what im asking for :P
}

我需要这个工作与Winforms和WPF如果重要,控制台会很好,但我不需要它..

I need this to work with Winforms and WPF if it matters, and Console would be nice to but I don't need it..

推荐答案

我只是意识到你可以做

char aaaa = (char)i;
//i is any alt code

这是最好的/唯一的方法,编码是这样的?

is this the best/only way, and what encoding is this in?

这篇关于从alt代码获取字符(无键盘事件)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 11:08