Recent

Author Topic: MouseAndKeyInput press "@" arroba key  (Read 269 times)

lainz

  • Hero Member
  • *****
  • Posts: 4150
    • https://lainz.github.io/
MouseAndKeyInput press "@" arroba key
« on: December 16, 2022, 12:26:21 am »
Hi, is possible to press @ key with this component?

This is my component, based on BGRAControls one. Attached.

It currently supports numbers, characters from a-z, (lowercase, uppercase are not working), Dot and comma.

dsiders

  • Hero Member
  • *****
  • Posts: 870
Re: MouseAndKeyInput press "@" arroba key
« Reply #1 on: December 16, 2022, 12:35:54 am »
Hi, is possible to press @ key with this component?

This is my component, based on BGRAControls one. Attached.

It currently supports numbers, characters from a-z, (lowercase, uppercase are not working), Dot and comma.

lcltype.pp has a comment that VK_AT is mapped to "another" key. Have you tried VK_LCL_AT or Shift + VK_2?
Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

lainz

  • Hero Member
  • *****
  • Posts: 4150
    • https://lainz.github.io/
Re: MouseAndKeyInput press "@" arroba key
« Reply #2 on: December 16, 2022, 10:45:38 pm »
Hi, is possible to press @ key with this component?

This is my component, based on BGRAControls one. Attached.

It currently supports numbers, characters from a-z, (lowercase, uppercase are not working), Dot and comma.

lcltype.pp has a comment that VK_AT is mapped to "another" key. Have you tried VK_LCL_AT or Shift + VK_2?

Thanks. I've added this line:

...
Code: Pascal  [Select][+][-]
  1. Application.QueueAsyncCall(PressRAltVirtKey, Ord(UpperCase('q')[1]));;
  2.  
...

Since on my keyboard the @ is in the Q key.

Code: Pascal  [Select][+][-]
  1. procedure TMyKeyboard.PressRAltVirtKey(p: longint);
  2. begin
  3.   KeyInput.Down(VK_LCL_RALT);
  4.   KeyInput.Down(p);
  5.   KeyInput.Up(p);
  6.   KeyInput.Up(VK_LCL_RALT);
  7. end;

The thing it will only work on my keyboard, and someone can have a keyboard like you that the @ is in the 2 key.

Also you say Shift + 2, and I have Right Alt + Q :S
« Last Edit: December 16, 2022, 10:51:33 pm by lainz »

 

TinyPortal © 2005-2018