Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Force @ regardless if UK or US keyboard selected in windows (Read 79 times)
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Oct 5th, 2023
Force @ regardless if UK or US keyboard selected in windows
Sep 12th, 2024 at 6:38am
Print Post  
I noticed that if the UK keyboard is selected, the @ symbol above the 2 key turns into " .

We also have a dedicated @ key but it simulates a SHIFT 2 which ofcourse results in " entered into the textbox.

How can I force the @ to be @ reglardless of UK or US keyboard? Even if it just for the dedicated key, although ideally both on both keys.

Or is there a way to force the Mindfusion to be US keyboard regardless of the windows selected keyboard? I can't change the keyboard system wide as the app will be running in an account that is locked down.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3228
Joined: Oct 19th, 2005
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #1 - Sep 12th, 2024 at 10:47am
Print Post  
RegularKey always sends its virtual key code translated through current language table, unless you set the Content property. For the dedicated @ key, you can set RegularKey.Content property to "@", or replace the key with UnicodeKey instance, instead of using Shift+2 ExtendedKey sequence.

If the keyboard is only used internally for your application, you could handle the WM_INPUTLANGCHANGEREQUEST Windows message to prevent language changes (but then UK users wouldn't be able to type their pound character).

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Oct 5th, 2023
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #2 - Sep 16th, 2024 at 1:17am
Print Post  
I have specified as

    <Key xsi:type="UnicodeKey">
      <Left>73.346153846153982</Left>
      <Top>186</Top>
      <Width>60</Width>
      <Height>40</Height>
      <Character>64</Character>
      <Repeat>1</Repeat>
    </Key>


In the keyboard creator when I do a test, the @ is entered as expected.
However in my WPF application no character is entered when I press this key.

I am initializing as below:

            AutoReleaseModifierKeys = true;
            AutoFill = true;
            TemplateLayout = KeyboardLayout.Create(Assembly.GetExecutingAssembly().GetManifestResourceStream(
"XXXX.resources.vkb_general_template.xml"));
            AutoRepeat = false;
            AutoUpdateCulture = false;
            IsStandAlone = false;
  
Back to top
 
IP Logged
 
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Oct 5th, 2023
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #3 - Sep 16th, 2024 at 1:35am
Print Post  
I'm using 5.0.4 nuget version of MindFusion.Keyboard.Wpf

  
Back to top
 
IP Logged
 
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Oct 5th, 2023
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #4 - Sep 16th, 2024 at 2:14am
Print Post  
Ok I found the issue. If you make the virtualkeyboard "collapsed" by default in WPF XAML the unicodekey do not work.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3228
Joined: Oct 19th, 2005
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #5 - Sep 16th, 2024 at 11:02am
Print Post  
UnicodeKey seems to work after un-collapsing in our test project attached here. Please let us know what we should change to reproduce that.

Regards,
Slavcho
Mindfusion
  

UnicodeKeys.zip ( 3 KB | 6 Downloads )
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint