I’ve scoured the forums and Googled around, can’t seem to pin this one down.
I have a form where a user can enter data in several fields by tabbing through them, including a combobox. Pressing the Return/Enter key in any field natively triggers an ‘OK’ pushbutton with the Default property set to true to commit changes to the entire data set.
This works fine, except the combobox is tripping me up. When using the keyboard up/down arrow keys, the list of items pops up, but pressing Return/Enter accepts the selection AND triggers the OK button at the same time. What I want to happen is have the Return/Enter key accept the selected list item if the list is visible, but not trigger the OK button. Then, only if if the list is closed and the user presses Return/Enter, allow the OK button to be triggered as usual.
I can trap the Return/Enter keys but it’s all or nothing. I can’t find a Xojo combobox property that gives me a boolean value whether the list is visible or not. That way you could selectively trap the keys if the list was open but allow the keys through otherwise.
I realize if you use the mouse to select a list item, the OK button will not trigger. But keyboard use is important in this app.
I’m on OS X 10.10.3. I’m not sure if this behavior is different on Windows or Linux, could be an OS X- specific issue (but assuming it’s cross-platform).
Any thoughts?