Skip to content
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

[WIP] Multi-device support #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goretkin
Copy link

#13

@ggoretkin-bdai
Copy link

@jtsiomb Is this what you had in mind? It would be nice to avoid basically doubling the number of events for the multi-device mode on the libspnav side.

@jtsiomb
Copy link
Contributor

jtsiomb commented Jan 22, 2024

It seems a bit more complicated than it has to be. First of all I wasn't thinking about adding more event types, but rather modifying how existing events work, when the client selects multi-device mode. Another thing is that most of these changes are about passing an extra argument to all the event handling functions, but the device id could just as well be a field in the event, instead of an extra argument. Also a minor point, but is_client_multidev feels like a dumb accessor which only ever returns a client field, so we might as well just access the field directly.

libspnav and the stability of its ABI needs some thought. Since event structures are not opaque, there is no acceptable way to add extra fields. The period field which i had in mind and could be co-opted for this is only present in motion events, and I certainly wouldn't want to add a bunch of more event types and structures just for this... at least not unless absolutely necessary. I'm leaning towards handling the device id information internally, somehow associating it with each event in a secondary data structure, and adding a function for the application to retrieve it. Complicated, but probably the only way to have the extra information without breaking compatibility.

@goretkin
Copy link
Author

but rather modifying how existing events work, when the client selects multi-device mode.

For example, on the spacenavd side:

struct event_button {
	int type;
	int press;
	int bnum;
};

so do you think there should be an additional field in that event?

@jtsiomb
Copy link
Contributor

jtsiomb commented Jan 22, 2024

no, in spacenavd and in the protocol, for a discussion of what libspnav needs to do, see the second paragraph of my last message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants