Hardkeys and tables

markbarrett_1

Member
Licensed User
Longtime User
Hi,

Is there a way of just trapping the KeyEnter hardware event so I can take some action on that, but pass all the other hardware events to the underlying control (in this case a table) so the wheel thing on my phone still scrolls through a table listing, but when I hit the Key Enter it does something. As soon as I define a hardware event for the form I loose normal event processing for the table object.

Alternatively is there a method I can call to move the current highlighted field up or down on the table control under my program control?

Thanks.

Cheers.

M
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Alternatively is there a method I can call to move the current highlighted field up or down on the table control under my program control?
Yes, with Table.SelectCell.
B4X:
Sub btnUp_Click
    table1.SelectCell(table1.SelectedCol,Max(0,table1.SelectedRow-1))
End Sub

Sub btnDown_Click
    table1.SelectCell(table1.SelectedCol,Min(table1.RowCount-1,table1.SelectedRow+1))
End Sub
 

markbarrett_1

Member
Licensed User
Longtime User
Hi Erel,

Just a quick word to say work perfectly and thanks for the suggestion.

For others I have found that if you want the scroll button to work as soon as the form is displayed (trying to make the user interface "tight") you need to ensure the control has focus set on showing the form. I have 3 pda's that I test on and the behaviour of all three was different until I set the control to have focus explicitly.

Thanks.

Cheers.

M
 
Top