Exemple #1
0
        public void UpdateText()
        {
            if (Global.kbLayout.Loaded_Localization.IsAutomaticGeneration())
            {
                //if (keyCap.Text.Length > 1)
                //    return;

                StringBuilder sb        = new StringBuilder(2);
                var           scan_code = KeyUtils.GetScanCode(associatedKey);
                if (scan_code == -1)
                {
                    return;
                }

                /*var key = KeyUtils.GetFormsKey((KeyboardKeys)associatedKey.LedID);
                 * var scan_code = KeyUtils.MapVirtualKeyEx((uint)key, KeyUtils.MapVirtualKeyMapTypes.MapvkVkToVsc, (IntPtr)0x8090809);*/

                int ret = KeyUtils.GetKeyNameTextW((uint)scan_code << 16, sb, 2);
                keyCap.Text = sb.ToString();
            }
        }