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


I Love MindFusion!

Posts: 19
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: 3376
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: 19
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: 19
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: 19
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: 3376
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 | 110 Downloads )
Back to top
 
IP Logged
 
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 19
Joined: Oct 5th, 2023
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #6 - Oct 1st, 2024 at 2:48am
Print Post  
Strange. The project basically had a global keyboard and a ContentPresenter control where the views were injected into. The keyboard was collapsed at launch and then sometime later during the application and keyboard was made visible and the unicode keys didn't work. However now I make the keybaord visible and then collapse at launch and seems to work. I tested this multiple times so I am confident it was related we now no longer have the issue with the workaround.

May I suggest collapsing the keyboard in XAML, and then maybe in a button press making the keyboard visible and then see if the unicode characters are working?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3376
Joined: Oct 19th, 2005
Re: Force @ regardless if UK or US keyboard selected in windows
Reply #7 - Oct 1st, 2024 at 6:00am
Print Post  
Quote:
collapsing the keyboard in XAML, and then maybe in a button press making the keyboard visible


That's what our test project above does:

Code
Select All
<vkb:VirtualKeyboard ...Visibility="Collapsed" /> 



Quote:
ContentPresenter control where the views were injected into


Do you mean that ContentPresenter is initially collapsed, and you are adding the keyboard to it dynamically?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint