-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for multiple keymap/menufunc to km_dokey_event() #3954
base: main
Are you sure you want to change the base?
Conversation
56deafd
to
5ec8d55
Compare
5ec8d55
to
c1f7bc8
Compare
c1f7bc8
to
dfc8298
Compare
void *hsmap[] = { &Keymaps[MENU_ALIAS], &Keymaps[MENU_GENERIC], 0 }; | ||
void *hsfuncs[] = { OpAlias, 0 }; | ||
op = km_dokey2(hsmap, hsfuncs, GETCH_NO_FLAGS); | ||
// op = km_dokey(MENU_ALIAS, GETCH_NO_FLAGS); |
Check notice
Code scanning / CodeQL
Commented-out code Note
void *hsmap[] = { &Keymaps[MENU_FOLDER], &Keymaps[MENU_GENERIC], 0 }; | ||
void *hsfuncs[] = { OpBrowser, OpGeneric, 0 }; | ||
op = km_dokey2(hsmap, hsfuncs, GETCH_NO_FLAGS); | ||
// op = km_dokey(MENU_FOLDER, GETCH_NO_FLAGS); |
Check notice
Code scanning / CodeQL
Commented-out code Note
*/ | ||
struct KeymapSeq | ||
{ | ||
// struct Keymaps *name; |
Check notice
Code scanning / CodeQL
Commented-out code Note
void *hsmap[] = { &Keymaps[MENU_DIALOG], &Keymaps[MENU_GENERIC], 0 }; | ||
void *hsfuncs[] = { OpDialog, OpGeneric, 0 }; | ||
op = km_dokey2(hsmap, hsfuncs, GETCH_NO_FLAGS); | ||
// op = km_dokey(MENU_DIALOG, GETCH_NO_FLAGS); |
Check notice
Code scanning / CodeQL
Commented-out code Note
void *hsmap[] = { &Keymaps[MENU_PAGER], &Keymaps[MENU_GENERIC], 0 }; | ||
void *hsfuncs[] = { OpPager, 0 }; | ||
op = km_dokey2(hsmap, hsfuncs, GETCH_NO_FLAGS); | ||
// op = km_dokey(MENU_PAGER, GETCH_NO_FLAGS); |
Check notice
Code scanning / CodeQL
Commented-out code Note
dfc8298
to
54c72ba
Compare
2f6b533
to
e33492e
Compare
9deb06f
to
d730e22
Compare
d730e22
to
780224e
Compare
57cec06
to
dff703f
Compare
dff703f
to
bece957
Compare
void *hsmap[] = { &Keymaps[MENU_INDEX], &Keymaps[MENU_GENERIC], 0 }; | ||
const void *hsfuncs[] = { OpIndex, OpGeneric, 0 }; | ||
op = km_dokey2(hsmap, hsfuncs, GETCH_NO_FLAGS); | ||
// op = km_dokey(MENU_INDEX, GETCH_NO_FLAGS); |
Check notice
Code scanning / CodeQL
Commented-out code Note
bece957
to
11c47de
Compare
I just wanted to get the ball rolling on this.
On the long run, if this is going to fly I believe it requires a third component.
That is the menu domain we've been talking the last time.
I'm not fully certain how this is going to fall into place.
We were discussing having :
DomainPager = { OpPager, pager_function_dispatcher() }
but perhaps we can do a global domain table where we could find our dispatcher() based on the calling parameters.
obviously OpBrowser will trigger browser_function_dispatcher() and OpGeneric will trigger global dispatcher.
There is the matter of menu dispatcher called infrequently or index dispatcher for that matter, I'm not sure what to do about them.
Moving on, we import OpAlias, OpGeneric from functions.h but we have a local functions.h in each dialog's directory, perhaps we can move those to keymap.h.
I was setup to use structs for function prototypes but I'd fallen on void. I was not sure about the final prototype and wanted to avoid: { { param}, {param}, {0} }. I've kept the original prototypes in keymap.h though. Also I've made km_dokey_event2() as per your initial thought on this, it's easier to switch back.
Finally I've ignored mw_get_field() and the _notify part for that matter as well, I believe the whole PR is going to be in need for a makeover. Though the way I'm dragging things perhaps I should consider doing the sidebar things the way are right now and get it out of the way.
PS. If this is going to trigger build breakage I've no idea how to test 'em beforehand