Skip to content

per device config#110

Draft
BKSalman wants to merge 5 commits into
AndyFilter:masterfrom
BKSalman:feature/per-device-config
Draft

per device config#110
BKSalman wants to merge 5 commits into
AndyFilter:masterfrom
BKSalman:feature/per-device-config

Conversation

@BKSalman

@BKSalman BKSalman commented Jul 22, 2026

Copy link
Copy Markdown

this adds per device config

current status:
it kinda works, but I'm currently trying to make the sysfs config path more user-friendly, but I'm still figuring out how sysfs works

TODOs:

  • pass constants as parameters instead of using globals
  • make writes and reads more safe by locking the device parameters/config on writes
  • use user-friendly sysfs config path
  • parse LUT on write
  • test all acceleration modes (somehow, IDK yet)

@BKSalman BKSalman changed the title WUFeature/per device config WIP: Feature/per device config Jul 22, 2026
@BKSalman
BKSalman marked this pull request as draft July 22, 2026 20:29
@BKSalman BKSalman changed the title WIP: Feature/per device config per device config Jul 22, 2026
@BKSalman

BKSalman commented Jul 22, 2026

Copy link
Copy Markdown
Author

I'm picking this up again after I left it for a while, so I'm kinda rebuilding the context of what I'm working on (basically I forgot what I was doing lol)

@BKSalman
BKSalman force-pushed the feature/per-device-config branch from c26c2ff to dd43f5e Compare July 22, 2026 20:43
@BKSalman
BKSalman force-pushed the feature/per-device-config branch from dd43f5e to c623eee Compare July 23, 2026 21:31
@BKSalman

BKSalman commented Jul 23, 2026

Copy link
Copy Markdown
Author

config paths now look something like /sys/class/yeetmouse/mouse_name/accel_config/acceleration

in my case /sys/class/yeetmouse/Kensington_ORBIT_WIRELESS_TB_Mouse/accel_config/acceleration

I have tested configuring multiple mice with different configurations and it's working :)

@BKSalman

Copy link
Copy Markdown
Author

I'm not really familiar with all the acceleration modes, so I'm not sure how to test them, @AndyFilter if you have any suggestion it would be helpful, or maybe some collection of input values to test manually

@AndyFilter

Copy link
Copy Markdown
Owner

I have tested configuring multiple mice with different configurations and it's working :)

Awesome! That's great to hear, the progress is faster than I expected.

I'll test the code myself too soon. Quickly looking at the CI that failed - I think it's just an issue with some includes, so once that's fixed you'll be able to build and run the unit tests. But I doubt anything has changed, as you didn't change any acceleration function implementation. I'll take a look at the tests right now, maybe it's an easy fix. (Also, when running the tests, you don't need to copy and files, or use any python scripts anymore, I just forgot to remove that from the instructions.)

I'm not really familiar with all the acceleration modes, so I'm not sure how to test them, AndyFilter if you have any suggestion it would be helpful, or maybe some collection of input values to test manually

I'm not sure what exactly are you asking about, simple unit tests for all the acceleration modes/functions, if so, then the Tests suite is your friend: https://github.com/AndyFilter/YeetMouse/tree/master/tests. If you want to check if a given mode applied on your system ACTUALLY applies the correct acceleration, then you need a bit more sophisticated setup; and a external device that can emulate a mouse. You don't have to test for this, I'll take care of it, in some spare time, as I already have everything set up, just need to plug the microcomputer to my PC.

@AndyFilter AndyFilter left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have time to look through the driver code yet. But I left some general comments. About the headers - I will push the commit fixing this later today or tomorrow, as I had to go and didn't have time to finish it. Also, I moved the ModesConstants struct to accel.h, as it's not really a shared definition, because from what I can see only the driver uses it. This also solved most of the compilation issues for the GUI and the Testing Suite. I already managed to get the GUI to compile and work locally, next I'll try to work on the Testing Suite, but that should be a similar story. About the headers in general, it's a slippery topic, as one compiler will accept one thing while the other will not, but I'd try to stick to what was already in the code, as no one seemed to complain about it for some time - meaning it might be working just fine.

Comment thread driver/FixedMath/FixedUtil.h Outdated
// Include numeric types
#include <linux/types.h>

#include <linux/kernel.h>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This header is already included in Fixed64.h, just in the other order. I swapped the order and it seems to work.
Edit: There is quite a bit of comments like these regarding the includes, I have fixed these issues in my local code, so I won't leave comments on the rest.

@BKSalman BKSalman Jul 25, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it didn't work for me for some reason, I will wait for your fixes to try them out 🫡

PS: might be an LSP thing

Comment thread driver/accel_modes.h
Comment on lines +31 to +38
FP_LONG accel_linear(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed);
FP_LONG accel_power(const struct ModesConstants *constants, FP_LONG midpoint, FP_LONG acceleration, FP_LONG exponent, bool use_smoothing, FP_LONG speed);
FP_LONG accel_classic(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed);
FP_LONG accel_motivity(const struct ModesConstants *constants, FP_LONG midpoint, FP_LONG speed);
FP_LONG accel_synchronous(const struct ModesConstants *constants, FP_LONG acceleration, bool use_smoothing, FP_LONG speed);
FP_LONG accel_natural(const struct ModesConstants *constants, FP_LONG midpoint, bool use_smoothing, FP_LONG speed);
FP_LONG accel_jump(const struct ModesConstants *constants, FP_LONG midpoint, bool use_smoothing, FP_LONG speed);
FP_LONG accel_lut(unsigned long lut_pairs, const FP_LONG lut_data_x[MAX_LUT_ARRAY_SIZE], const FP_LONG lut_data_y[MAX_LUT_ARRAY_SIZE], FP_LONG speed);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead of passing all the parameters that a given function uses pass the struct accel_params *params? This would greatly reduce the API's complexity for the driver as well as the Testing Suite.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that would make it clearer, but I can change it no problem

@AndyFilter

Copy link
Copy Markdown
Owner

Hey, I pushed the commit I was talking about earlier that fixes the GUI building. But I didn't entirely fix the Test Suite as it would require fixing all the - now changed - acceleration modes functions (like accel_linear()) calls; and since we want to move passing the entire accel_params to them instead, it's be a work done for nothing. So I think you can update this, when changing the prototypes prototypes of these functions.
Also, this change is quite a significant impact on the Test Suite ("system" wise), so if you're unsure about something I'll handle it, as I sometimes like things done my way.

btw. let me know if the driver compiles now, after I removed some includes. I tested it and it did compile and work, but I couldn't find the /sys/class/yeetmouse/ directory, but I didn't add any special rules for any of the devices. I'm not sure how it's supposed to work right now, as also there are not new GUI elements yet.

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.

2 participants