Key code

Key code

Postby Silvio.Falconi » Mon Nov 24, 2014 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby ukoenig » Mon Nov 24, 2014 6:44 pm

Silvio,

You can try :

Code: Select all  Expand view  RUN

#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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Key code

Postby Silvio.Falconi » 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: Select all  Expand view  RUN
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 ?
Last edited by Silvio.Falconi on Tue Nov 25, 2014 11:53 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby Enrico Maria Giordano » Tue Nov 25, 2014 11:48 am

Silvio,

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Key code

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby Jeff Barnes » Tue Nov 25, 2014 1:12 pm

Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Key code

Postby karinha » Tue Nov 25, 2014 4:57 pm

Code: Select all  Expand view  RUN

   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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Key code

Postby Silvio.Falconi » Tue Nov 25, 2014 5: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

Image


If I press numpad button I see

Image
Last edited by Silvio.Falconi on Tue Nov 25, 2014 5:58 pm, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby karinha » Tue Nov 25, 2014 5:49 pm

if I understand,

Code: Select all  Expand view  RUN

   elseif nKey == 105 //VK_NUMPAD9 - in vkey.ch
      oBt9:click()
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Key code

Postby Silvio.Falconi » Tue Nov 25, 2014 6: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: Select all  Expand view  RUN

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby karinha » Tue Nov 25, 2014 6: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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Key code

Postby Silvio.Falconi » Tue Nov 25, 2014 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Key code

Postby karinha » Wed Nov 26, 2014 11:40 am

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Key code

Postby karinha » 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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 71 guests