自定义文字处理器的键盘布局ID [英] Keyboard layout ID for Custom Word Processor

查看:112
本文介绍了自定义文字处理器的键盘布局ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我正在使用C#应用程序(本地语言的自定义文字处理器).本地语言使用英语字母的大多数字母,但字母"q"和"x"应替换为ɛ"和ɔ".

在Google中徘徊之后,点击使我有了激活希伯来语键盘布局的想法,这可以帮助我在按下"q"和"x"时获得所需的符号(因为我已经有了支持字符ɛ"的字体文件和ɔ").

问题是如何在我的C#应用​​程序中使用此希伯来语键盘布局.

非常感谢您的帮助.

Hi friends,

I am working on a C# application(Custom Word Processor in local language). The local language uses most of the letters of the English alphabet except the letters "q" and "x" which should be replaced with "ɛ" and "ɔ".

After wandering through Google, a hit gave me an idea of activating Hebrew keyboard layout and this may help me get the desired symbols anytime the "q" and "x" are pressed(as I already have font files that support the characters "ɛ" and "ɔ").

The problem is how to use this Hebrew keyboard layout in my C# application.

Any help is greatly appreciated.

推荐答案

据我了解,您只需要希伯来语键盘布局即可.在全系统范围内使用它绝对是最好的. Windows捆绑的一种标准布局有什么问题?

好吧,我知道有什么问题.我使用第三方提供的非标准键盘布局;免费,但是没有开源.实际上,这种键盘(注音")的布局非常有价值(始终由大多数Linux发行版提供),并且可能使用率很高(如果不多于标准的键盘,我不知道),但是Microsoft对此很粗心因此,即使有很多人离不开它,它也从未包含在任何版本中.

因此,您可能想尝试从该产品作者的建议中寻求建议,这实际上是对我的文化唯一的好处.请参见 http://winrus.com/kbd_e.htm [应用程序焦点的得失 [在BACKSPACE按钮上编程 [适用于您的软件虚拟键盘WPF应用 [ ^ ].

—SA
As I understand, you only needs a Hebrew keyboard layout. It''s absolutely the best to have it system-wide. What''s wrong with one of the standard layouts bundled with Windows?

Well, I know what can be wrong. I use non-standard keyboard layout from third-party; free but no Open Source, unfortunately. Actually, this keyboard — "phonetic" — layout is extremely valuable (always provided by most distro of Linux) and maybe highly used (if not more then the standard one, I don''t know), but Microsoft is so careless about it so it was never included in any version, even though there are many people who cannot leave without it.

So, you may want to try to ask an advice from the advice from the author of this product, which is practically the only one good for my culture. See http://winrus.com/kbd_e.htm[^]. I don''t think he does Hebrew but he may know how to approach the problem of system-wide keyboard layout.

(Again, are you sure everyone bundled with Windows is not good?)

If you want to stay with the application-specific keyboard layout, this is more easy.
You can follow the idea shown by Nagy, but of course it should be done more seriously. Use System.Collections.Generic.Dictionary<char, char> for character translation dictionary; always persist it on the disk, provide a feature to replace it during run-time.

You also need to present an image of the altered keyboard on screen, otherwise your user will be lost.
The best thing to do it is creating your own Virtual Keyboard.

Here you can find the key recipe for doing it:
Application focus getting and losing[^],
Programming on BACKSPACE button[^].

See also this CodeProject article: A software Virtual Keyboard for your WPF apps[^].

—SA


如果您正在查看希伯来语条目,则用户可能会使用希伯来语键盘来获取正确的代码.

如果要更改按键,则始终可以...覆盖...按键事件.

像这样向控件添加事件[交换ao:
If you''re looking at hebrew entry, then the user will probably be using a hebrew keyboard to get the correct codes.

If you want to change the keypresses, then you could always ... override ... the ... keypress ... event.

Add an event to the control like this [swaps a and o:
private void richTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar == 'a')
    {
        e.KeyChar = 'o';
    }
    else if (e.KeyChar == 'o')
    {
        e.KeyChar = 'a';
    }
}


这篇关于自定义文字处理器的键盘布局ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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