Jump to content
shineworld

TTouchKeyboard layout

Recommended Posts

Posted (edited)

Hi all.

 

I'm on a PC with the Italian language and an Italian true keyboard.
In the VCL software, I would like to use the TTouchKeyboard.

Is a technical software where I need to force TTouchKeyoard to display US keyboard layout,

because chars as [ ] | # etc are mandatory instead of accented èéòàù of  specific Italian layout.

 

I've imported the Vcl.Touch.Keyboard.pas in project to add minor graphics changes, which works fine,

but I'm not able to understand how to force English layout.

 

I've tried to change CreateKeyboard method to say "use alwyas 'en' but doesn't works.

 

function TCustomTouchKeyboard.CreateKeyboard(const Language: string): Boolean;
var
  Index, RowIndex, ColIndex: Integer;
  Button: TCustomKeyboardButton;
  LeftPosition, TopPosition: Integer;
  KeyboardState: TKeyboardState;
  KeyboardLayout: TVirtualKeyLayout;
  Row: TVirtualKeys;
  FoundCaps: Boolean;
  _Language: string;
begin
  Result := False;
  FoundCaps := False;
  for Index := 0 to FButtons.Count - 1 do
    FButtons[Index].Free;
  FButtons.Clear;
  FDeadKey := VKey(-1, -1);
  TopPosition := 0;

  _Language := 'en';
  if _Language <> '' then
    FLanguage := _Language;


The result is always:
image.thumb.png.3cbebac0f28a47c4713b29f1d1dfc2d0.png

 

There is a way to force it ?

Edited by shineworld

Share this post


Link to post

Sorry but it looks you have an English layout. What did I miss in your post?

Share this post


Link to post
Posted (edited)

This is the "English" layout that I mean:
usenglish-windows-keyboard-layout-keyshorts_1024x1024.thumb.jpg.8d36067243b6414d1272b27f39a609db.jpg
I can obtain this layout "forcing" the entire system to use US keyboard layout language instead of "IT" with:

ActivateKeyboardLayout(67699721 {en-US}, 0);
Application.ProcessMessages;
TouchKeyboard1.Redraw;

but I wouldn't change how the physical keyboard works, overall the native customer keyboard,

for eg. is Japanese and would use a physical keyboard to edit strings,

but only the TTouchKeyboard component layout.

Edited by shineworld

Share this post


Link to post

That's what I do as well: I just change the systems keyboard layout so the TTouchkeyboard will follow. When not longer needed, you can also unload the English keyboard layout again so it will not show up ion the users language list ([Win] + [Space]).

 

I am doing a kiosk application however. I also wouldn't be comfortable with doing that in a regular application...

Share this post


Link to post
Posted (edited)
2 hours ago, Der schöne Günther said:

That's what I do as well: I just change the systems keyboard layout so the TTouchkeyboard will follow. When not longer needed, you can also unload the English keyboard layout again so it will not show up ion the users language list ([Win] + [Space]).

Yes, I've already tried that, but, end-user will have a touch keyboard to enter code in the display panel + a physical keyboard (Japanese or Russian in this case) to enter texts in native Unicode mode.
I need to have Windows working with Japanese or Russian native user language but the touch keyboard with the US for fast code editing in the display keybaord.

I'm trying to understand TTouchKeyboard to "overload" how works o I will move to a custom keyboard component created from zero.

Edited by shineworld

Share this post


Link to post

In that case I'm not sure if spending too much time with TTouchKeyboard is even worth the hassle. Design your own English keyboard on a TFrame, you have full control and flexibility here.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×