Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic RegularKey and styling (Read 952 times)
ruki
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 19
Joined: Oct 5th, 2023
RegularKey and styling
Nov 6th, 2023 at 1:34am
Print Post  
I have the following styling which came from one of the sample apps:

Code
Select All
    <DataTemplate DataType="{x:Type vk:RegularKey}">
        <ContentControl  HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
            <StackPanel IsHitTestVisible="False" Visibility="Visible" x:Name="sp" >
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <TextBlock Text="{Binding UpperCase}"/>
                    <TextBlock Text="{Binding AlterCase}" Foreground="Black" Margin="5 0 0 0"/>
                </StackPanel>
                <TextBlock Text="{Binding LowerCase}" HorizontalAlignment="Right" Foreground="Black"/>
            </StackPanel>
        </ContentControl>
    </DataTemplate>
 



And the following RegularKey template

Code
Select All
    <Key xsi:type="RegularKey">
      <Content xsi:type="xsd:string">8</Content>
      <Left>61</Left>
      <Top>120.52000000000004</Top>
      <Width>40</Width>
      <Height>40</Height>
      <VirtualKey>0</VirtualKey>
      <Repeat>1</Repeat>
    </Key>
 



When run the key has no label. In this case it is meant to be just a numeric pad and so shouldn't upper/lower case. How to style it correctly?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: RegularKey and styling
Reply #1 - Nov 6th, 2023 at 5:15am
Print Post  
Hi,

<VirtualKey>0</VirtualKey> does not display the digit 0. It specifies a Windows virtual key code instead -
https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

For digits, try values from 48 on (hex 0x30).

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


I Love MindFusion!

Posts: 19
Joined: Oct 5th, 2023
Re: RegularKey and styling
Reply #2 - Nov 6th, 2023 at 5:26am
Print Post  
How to make a key be just be '8' regardless of numlock/shift etc?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: RegularKey and styling
Reply #3 - Nov 6th, 2023 at 6:02am
Print Post  
Try setting RegularKey.Content = "8".

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