-
Notifications
You must be signed in to change notification settings - Fork 14
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
Keyboard interaction interface #15
Comments
We will need the |
I'm a bit out of my comfort zone here, so bear with me in case my concerns make no sense. If we have separate callbacks for a keyboard key being pressed and a modifier key being pressed, what does this look like for the program consuming the event? Let's saying I'm doing "C-z". It would first call keyboard_modifier_event, and then keyboard_key_event, right? So on the lisp side, I'm getting called into twice for what is essentially one event, with possible things like window updates etc happening in between? Wouldn't this add a fair amount of complication to the protocol? How do I as the client tell whether a modifier event and key event should be combined? Perhaps it would be simplest just to have a struct with both the key and the modifier(s) on it, and pass that to the keyboard event callback(and similar for mouse/wheel events)? From peeking at the C code, looks like the modifiers modifiers are just stored as a uint32 which I assume is a bitfield; that should be simple enough to pass to the lisp side as is, and translate it to something lispy like a list of modifiers or something on the lisp side. |
The reason the On the lisp side, my thinking was that since we would implement the |
In the c-core branch, the keyboard interaction callback interface is ready to be designed and implemented. All of the callbacks are hooked up and ready: the main thing to do is figure out what data should be passed to the callback, and if any wrapper functions in C need to be written.
Callback struct:
mahogany/heart/include/hrt/hrt_input.h
Lines 34 to 41 in b4b02b6
Function where the callback is invoked:
mahogany/heart/src/keyboard.c
Line 62 in b4b02b6
The text was updated successfully, but these errors were encountered: