替换自定义键盘键以显示在 C# 中的 RichTextbox 中

问题描述

你好世界! 我正在寻找解决方案,在输入 RichTextBox 键时,我想用其他语言的其他键替换我的一些键盘键。替换需要即时,例如,每当我输入 "A" 时,我想要 "ب" 或我其他想要的阿拉伯字母应该出现在 RichTextBox 中。提前致谢!

解决方法

当我在每种方法中通过 SendKeys.Send("ر"); 单击任何我的键时,我解决了将我想要的乌尔都语/普什图语字符串字母放在 RichTextBox1 中的问题。将richtextBox1内的key替换为字符串,而Capslock和Shift的单个按钮上两个字符串的异常可以通过

解决
if (chkCapsLock.Checked == true || chkShiftLeft.Checked == true || chkShiftRight.Checked == true)
        {
            SendKeys.Send("ړ");
            chkShiftLeft.Checked = false;
            chkShiftRight.Checked = false;

        }
        else
        {
            SendKeys.Send("ر");

        }