QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Use of arrows when changing focus |
Ref. No. |
QNX.000009873 |
Category(ies) |
Development |
Issue |
We have PhAB application that contains some PtText arranged in rows and columns. We would like to know if there is a way we can switch focus from one PtText to another using arrow keys, something like the 'tab' key, but in different directions(up, down, left, right).
|
Solution |
Set Pt_ENABLE_CUA_ARROWS in Pt_ARG_CONTAINER_FLAGS for the container that the PtText widgets are in. PtText consumes left and right arrow keys(they make the cursor left and right), so the keys to use will be up, down, Ctrl-Alt-Left and Ctrl-Alt-Right. For a rectangular matrix of widgets where all widgets are the same size, the keys should go where expected. For widgets not aligned in a perfect matrix, the focus may not always go to the widget you expect due to the algorithm for figuring out which widget to go to. If you want precise control of where the focus goes for up, down, left and right than you have to handle it manually.
Also set the Pt_SCROLL_AREA_IGNORE_KEYS bit of the Pt_ARG_SCROLL_AREA_FLAGS to ignore CUA keys and pass them to the child containers or child widgets.
|
|