Arrow keys don't work in ListBox in FW24 and XP

Arrow keys don't work in ListBox in FW24 and XP

Postby xhbcoder » Thu Oct 26, 2006 3:24 pm

Five Win,

We've hit a wall with arrow keys in some part of our POS. The Up and Down arrow keys is not working in a the List Box but in other part of the program like in popup menus it works fine.

Environment: XP, Clipper5.2, comix and FW24

Is there any FW update in the List box that may correct the this behavior?

Or there is anything I can tweak in the list box?

TIA
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Thu Oct 26, 2006 4:23 pm

Check that the listbox has the focus:

oListBox:SetFocus()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Fri Oct 27, 2006 4:05 pm

Antonio,

Thanks for the quick reply.

>Check that the listbox has the focus:
>oListBox:SetFocus()

The list box has focused. But somehow fivewin cannot process the up/down arrow keys.

Here's fragment of the code:

@ 0,0 listbox aObject[AO_JOURNALLIST] fields headers 'Journal xx' alias 'ARRAY' pixel

#define LINES_NONE 0
aObject[AO_JOURNALLIST]:nLineStyle := LINES_NONE

// aObject[AO_JOURNALLIST]:AdjClient()
// Below statement does same as above and handles resize
aObject[AO_JOURNALWINDOW]:SetControl(aObject[AO_JOURNALLIST])
aObject[AO_JOURNALLIST]:bKeyChar := GetWndFrame():bKeyChar

// Apply font and color after journal list box is created 03/17/2004 11:42AM
activate window aObject[AO_JOURNALWINDOW] on init ( oRect:Apply( self ), ClickEvent( aObject[AO_JOURNALLIST], 'Journal' ) ) ;
valid oRect:Save( aObject[AO_JOURNALWINDOW] ) .and. lChildEnd()
// logmsg( 'res.txt','Font ' +'aObject[AO_JOURNALWINDOW]:oFont:hFont' +' handle: ' +char( aObject[AO_JOURNALWINDOW]:oFont:hFont ) )

aObject[AO_JOURNALWINDOW]:Refresh()

aObject[AO_JOURNALWINDOW]:SetFocus() // FW recommendation - jdd

aObject[AO_JOURNALLIST]:bKeyDown:={||msgInfo("KeyCode: "+str(LS_getKeyPressed())+ " lastkey:" +str(lastkey()) )}


Observation:

The b:KeyDown is invoked by FW when Up/down Arrow keys is pressed.

The value of nKeyPressed is 255 in both up/down Arrow keys.

*************************
function LS_getKeyPressed
*************************
local i:=0,nKeyPressed:=0
for i=0 to 255
//if getKeyStat(i)
if getAsyncKey(i)
nKeyPressed=i
exit
endif
next i
return nKeyPressed


***************

Gracias,
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Sun Oct 29, 2006 10:31 am

If you are using a DBF index, please rebuild it, in case it may be corrupted.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Oct 29, 2006 10:34 am

Test it this way:

aObject[AO_JOURNALLIST]:bKeyDown:={| nKey | MsgInfo( nKey ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Sun Oct 29, 2006 10:07 pm

Antonio,


I am using array not DBF file . What is the value o:nLastKey? It is the same as getAsynckey(i)? I am getting 255 on up, down, left, right, and some other keys on POS keyboard. Is there any fivewin function that can properly identify these POS keys?


TIA,

Jose
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Mon Oct 30, 2006 12:04 am

Jose,

Check the values that you get here:

aObject[AO_JOURNALLIST]:bKeyDown:={| nKey | MsgInfo( nKey ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby xhbcoder » Mon Oct 30, 2006 9:47 pm

>Check the values that you get here:

>aObject[AO_JOURNALLIST]:bKeyDown:={| nKey | MsgInfo( nKey ) }

That helps a lot!

I wonder why it is not mentioned in the documentation that it can receive two parameters (nKey, nFlags)? Or I just missed it?

nFlag value was the essential data in this particular case.

MUCHAS GRACIAS AMIGO !!!!

Jose
xhbcoder
 
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Postby Antonio Linares » Mon Oct 30, 2006 10:59 pm

Jose,

De la documentación de classes de FWH:

<bKeyDown> Whenever the window has focus and a NON-SYSTEM key is pressed (ie the <Alt> key was not pressed in conjunction with this key), this codeblock will be called. When <bKeyDown> is called it receives two parameters: <nKey> The virtual key code of the key. <nFlags> Specifies several internal values like repeat code and scan code. For more information about these values please read a MS-Windows APIdescription about the WM_KEYDOWN message.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 6 guests