I have successfully manage to add an accelerator to a menu item with the gtk_widget_add_accelerator() function.
What bothers me is how i can add a custom accelerator that widget.With the first command i can add a shortcut like "Ctrl + A"; but what happens if i want to use the "Up" arrow key or F1 as an accelerator?
I managed to replace Ctrl + something with something itself.
That can be done simply by setting the value of
GdkModifierType
, which is the second from last parameter,to zero.For instance:
This will display F11 instead of Ctrl + F11.