FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Key code
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Key code
Posted: Mon Nov 24, 2014 06:08 PM

I need the key code number for Pagup and Pagdown
I saw on inkey and I tried

elseif nKey == K_PGUP

elseif nKey == K_PGDN

but it not run ok

Regards

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Key code
Posted: Mon Nov 24, 2014 06:44 PM
Silvio,

You can try :

Code (fw): Select all Collapse
#include "FiveWin.ch"

function main()
local oWnd

DEFINE WINDOW oWnd TITLE "Keys"

oWnd:bKeyDown := { | nKey | IIF( nKey = 33, MsgInfo( "Page UP : " + Str( nKey ) ), ), ;
                            IIF( nKey = 34, MsgInfo( "Page DOWN : " + Str( nKey ) ), ) }

ACTIVATE WINDOW oWnd

RETURN ( NIL )


Best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 11:21 AM
Uwe,
If I press from 1 to 9 on keyboard give me from 49 to 57

but I need the key code of the numbers of keypad

any help ?


Please try and paste this function with msgcalc()
Code (fw): Select all Collapse
STATIC FUNCTION VerKey(nKey,oBSum, oBMin, oBMol, oBDiv, oBPer, oBCan, oBRes)
if      nKey   == 107      // "+"
      oBSum:Click()
elseif   nKey   == 109      // "-"
      oBMin:Click()
elseif   nKey   == 106      // "*"
      oBMol:Click()
elseif   nKey   == 111      // "/"
      oBDiv:Click()
      
     elseif nKey ==  105
           oBt9:click()
      elseif nKey ==  104
           oBt8:click()
      elseif nKey ==  103
           oBt7:click()
        elseif nKey ==  102
          ? chr(nkey)
           oBt6:click()
      elseif nKey ==  101
           oBt5:click()
      elseif nKey ==  100
           oBt4:click()
      elseif nKey ==  99   .or. nkey== 51
           oBt3:click()
      elseif nKey ==  98   .or. nkey== 50
           oBt2:click()
      elseif nKey ==  97   .or. nkey== 49
           oBt1:click()     


      
      
      
end
RETU 0



for sample to understan the problem

If you press 1 (on keynumpad or on keyboard) the msgcalc write 1 on get

then if you press 2 then the msgcalc not write on get the number 2

only if you press C then the button "2" can run ok

how I can resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 11:48 AM
Silvio,

Code (fw): Select all Collapse
#define VK_NUMPAD0   96
#define VK_NUMPAD1   97
#define VK_NUMPAD2   98
#define VK_NUMPAD3   99
#define VK_NUMPAD4   100
#define VK_NUMPAD5   101
#define VK_NUMPAD6   102
#define VK_NUMPAD7   103
#define VK_NUMPAD8   104
#define VK_NUMPAD9   105


EMG
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 11:54 AM

Emg,
please read the previous message

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 12:16 PM
the error is on SayNum(oGet,xNum) function of msgcalc

if we use button on numpad msgcalc write the number allway at first position
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Key code
Posted: Tue Nov 25, 2014 01:12 PM
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Key code
Posted: Tue Nov 25, 2014 04:57 PM
Code (fw): Select all Collapse
   elseif nKey ==  34 //PAGE DOWN in vkey.ch

      ? [PAGE DOWN]

   elseif nKey ==  33 //PAGE UP   In vkey.ch

      ? [PAGE UP]


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 05:30 PM
friends I 'm trying to correct the msgcalc and use it on win 7 and win 8

the numkey are right

Now I saw the SayNum(oGet,xNum) function of msgcalc

this is compatible if the user press the buttons of odlg

this is not compatible if the user press the numpad keys of keyboard


because I need to simulate the click of the button on the dialog
sample :

elseif nKey == VK_NUMPAD9
oBt9:click()

it write the number allways on first position

if we digit ( press on numpad) the sequence 123 you see on get 323

I not Know why

sample: pressing a sequence from 1 to 9

If I press dialog button I see




If I press numpad button I see

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Key code
Posted: Tue Nov 25, 2014 05:49 PM
if I understand,

Code (fw): Select all Collapse
   elseif nKey == 105 //VK_NUMPAD9 - in vkey.ch
      oBt9:click()
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 06:01 PM
karinha,
the nkey are right

try msgcalc please

and use only the numbers you found on numpad of your keyboard NOT USE dialog buttons ( od msgcalc) and see what happen

Code (fw): Select all Collapse
STATIC FUNCTION VerKey(nKey,oBSum, oBMin, oBMol, oBDiv, oBPer, ;
                       oBCan, oBRes, oBivap, oBIvam, oBtnPast,oBt1,oBt2,oBt3,oBt4,oBt5,oBt6,oBt7,oBt8,oBt9,oBt0)
if      nKey   == 107      // "+"
      oBSum:Click()
elseif   nKey   == 109      // "-"
      oBMin:Click()
elseif   nKey   == 106      // "*"
      oBMol:Click()
elseif   nKey   == 111      // "/"
   oBDiv:Click()


  elseif  nKey == 008     // BackSpace
        oBtnPast:Click()

  elseif nKey == 067     // C
     oBCan:Click()



      elseif nKey ==   VK_NUMPAD9
           oBt9:click()
      elseif nKey == VK_NUMPAD8
           oBt8:click()
      elseif nKey ==  VK_NUMPAD7
           oBt7:click()
        elseif nKey ==  VK_NUMPAD6
           oBt6:click()
      elseif nKey ==  VK_NUMPAD5
           oBt5:click()
      elseif nKey ==  VK_NUMPAD4
           oBt4:click()
      elseif nKey ==  VK_NUMPAD3
           oBt3:click()
      elseif nKey ==  VK_NUMPAD2
           oBt2:click()
      elseif nKey ==  VK_NUMPAD1
           oBt1:click()
       elseif nKey ==  VK_NUMPAD0
           oBt0:click()

end
RETU 0
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Key code
Posted: Tue Nov 25, 2014 06:40 PM

Sorry, My version does not have this calculator.

See \samples\ TCALC.PRG if it is not better to control.

Regards.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Key code
Posted: Tue Nov 25, 2014 07:59 PM

It is a function from fw 1.4
.\source\function\msgcalc.prg

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Key code
Posted: Wed Nov 26, 2014 11:40 AM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Key code
Posted: Wed Nov 26, 2014 11:46 AM

Show your MsgCalc.prg

For I compare with my

What does not work?

Regards.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341