Recent

Author Topic: How to use NumPad1/2/... keys?  (Read 3981 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
How to use NumPad1/2/... keys?
« on: March 28, 2015, 08:09:01 pm »
I cannot see way to use NUM keys for Menus: cannot set Num+, Num- for menu items.
How to do it?
TextToShortcut('Num1') also bad?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to use NumPad1/2/... keys?
« Reply #1 on: March 28, 2015, 08:21:14 pm »
In fact, if you set minus signal as an ampersand char in a menu, it is activated by the minus signal, no matter it is on normal keyboard or num pad. The same occurs with numbers and other chars.
« Last Edit: March 28, 2015, 08:31:09 pm by typo »

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to use NumPad1/2/... keys?
« Reply #2 on: March 28, 2015, 09:07:14 pm »
It's not ok--need usage of Ctrl+NumPlus, Ctrl+NumMinus, how to set..

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to use NumPad1/2/... keys?
« Reply #3 on: March 28, 2015, 09:33:08 pm »
On Windows unit you have:

Code: [Select]
     VK_NUMPAD0 = 96;
     VK_NUMPAD1 = 97;
     VK_NUMPAD2 = 98;
     VK_NUMPAD3 = 99;
     VK_NUMPAD4 = 100;
     VK_NUMPAD5 = 101;
     VK_NUMPAD6 = 102;
     VK_NUMPAD7 = 103;
     VK_NUMPAD8 = 104;
     VK_NUMPAD9 = 105;
     VK_MULTIPLY = 106;
     VK_ADD = 107;
     VK_SEPARATOR = 108;
     VK_SUBTRACT = 109;
     VK_DECIMAL = 110;
     VK_DIVIDE = 111; 

which you can use in FormKeyDown event handler, for instance.

Code: [Select]
  if (ssCtrl in Shift) and (Key = ???) then;
« Last Edit: March 28, 2015, 09:37:29 pm by typo »

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to use NumPad1/2/... keys?
« Reply #4 on: March 28, 2015, 09:38:21 pm »
good; can I have better code? I want text ini file with keys: eg

[key]
CommandSome=Ctrl+Shift+A

i read it via TextToShortcut().
this way I cannot setup Num keys, via ini file?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to use NumPad1/2/... keys?
« Reply #5 on: March 28, 2015, 09:41:53 pm »
You can write in your menu that Ctrl+NumPadPlus makes something as a menu item, for instance. And you can load if from an ini file, for instance.

File
------------------------------
Open         Ctrl+NumPadPlus
« Last Edit: March 28, 2015, 09:43:52 pm by typo »

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to use NumPad1/2/... keys?
« Reply #6 on: March 28, 2015, 09:45:29 pm »
no, I cannot as TShortcut cannot get texttoshortrcut('Ctrl+Num+')

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to use NumPad1/2/... keys?
« Reply #7 on: March 28, 2015, 10:01:37 pm »
TextToShortCut function is declared on LCLProc unit.

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to use NumPad1/2/... keys?
« Reply #8 on: March 28, 2015, 10:17:38 pm »
I know. Prob is "TextToShortcut('Num+')" is 0
I try to make patch

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: How to use NumPad1/2/... keys?
« Reply #9 on: March 28, 2015, 11:08:07 pm »
patch MADE.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: How to use NumPad1/2/... keys?
« Reply #10 on: March 29, 2015, 01:01:18 pm »
If you set ShortCut as 16491, it is OK.

 

TinyPortal © 2005-2018