4coder » Forums » How to get item pressed by keyboard
NayGames
Adrien
5 posts
#21519 How to get item pressed by keyboard
3 weeks, 5 days ago Edited by Adrien on Aug. 26, 2019, 8:49 a.m. Reason: Initial post

Hello I find this
1
2
tatic UI_Item
lister_get_clicked_item(Application_Links *app, View_Summary *view, Partition *scratch)
for the mouse but I don't find for the keyboard
mrmixer
Simon Anciaux
663 posts
#21528 How to get item pressed by keyboard
3 weeks, 4 days ago Edited by Simon Anciaux on Aug. 27, 2019, 10:14 a.m. Reason: typo

I've never written a custom lister, but I think you're supposed to set an Activation Handler that will be called when an item is activated (either by mouse or keyboard). The function has an activated_by_mouse parameter. It's from 4coder_ui_helper.h and there are examples of custom uis in 4coder_lists.cpp.

1
2
3
typedef void Lister_Activation_Function_Type(Application_Links *app, Partition *scratch, Heap *heap,
                                             View_Summary *view, struct Lister_State *state,
                                             String text_field, void *user_data, bool32 activated_by_mouse);
NayGames
Adrien
5 posts
#21529 How to get item pressed by keyboard
3 weeks, 3 days ago

Yes I don't see Lister_State thank you !