-
Notifications
You must be signed in to change notification settings - Fork 20
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
Ability to obtain position of a key, not just keycode #12
Comments
lol.. i made this yesterday just for fun in my rgb sdk test code.. this is for ISO keyboards: const int posx[] = {
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 */
/* 0 */ 17, -1, 55, 74, 93, 112, 142, 161, 180, 199, 227, 246, 265, 284, 309, 328, 347, 371, 390, 409, 428,
/* 1 */ 17, 36, 55, 74, 93, 112, 131, 150, 169, 188, 207, 226, 245, 275, 309, 328, 347, 371, 390, 409, 428,
/* 2 */ 23, 47, 66, 85, 104, 123, 142, 161, 180, 199, 218, 237, 256, -1, 309, 328, 347, 371, 390, 409, 428,
/* 3 */ 25, 51, 70, 89, 108, 127, 146, 165, 184, 203, 222, 241, 260, 283, -1, -1, -1, 371, 390, 409, -1,
/* 4 */ 20, 41, 60, 79, 98, 117, 136, 155, 174, 193, 212, 231, -1, 268, -1, 328, -1, 371, 390, 409, 428,
/* 5 */ 20, 44, 68, -1, -1, -1, 140, -1, -1, -1, 211, 235, 259, 283, 309, 328, 347, -1, 380, 409, -1
};
const int posy[] = {
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 */
/* 0 */ 18, -1, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
/* 1 */ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
/* 2 */ 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, -1, 62, 62, 62, 62, 62, 62, 70,
/* 3 */ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 70, -1, -1, -1, 81, 81, 81, -1,
/* 4 */ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, -1, 100, -1, 100, -1, 100, 100, 100, 108,
/* 5 */ 119, 119, 119, -1, -1, -1, 119, -1, -1, -1, 119, 119, 119, 119, 119, 119, 119, -1, 119, 119, -1
};
const int posxminbound = 8;
const int posyminbound = 9;
const int posxmaxbound = 437;
const int posymaxbound = 128;
const int posxmin = 17;
const int posymin = 18;
const int posxmax = 428;
const int posymax = 119;
// total height: 149mm
// total width: 446mm for ansi: all numbers without warranty. values are in millimeters (cause nobody cares about imperial) offsets were measured manually. RGB example: for(int i = 0, buttons = WOOTING_RGB_COLS * WOOTING_RGB_ROWS; i < buttons; i++) {
if (posx[i] < 0) continue;
int x = i / WOOTING_RGB_COLS;
int y = i % WOOTING_RGB_COLS;
double px = (double)(posx[i] - posxmin) / (posxmax - posxmin);
double py = (double)(posy[i] - posymin) / (posymax - posymin);
wooting_rgb_direct_set_key(x, y, px * 255, 255 - py * 255, (1 - px) * py * 255);
usleep(20000);
} |
I suggest using the keycodes/indices from the configuration interface (used by Wootility) and a mapping to cols/rows on the SDK side (sort of like in the RGB SDK). The mapped keycode could be passed alongside for the new keycode type only. The advantages would be:
|
This might be worth revisiting for the Wooting UwU since remapping is pretty integral to this device's usage, so any assumption about where a key is located goes right out of the window. |
Previous to the Remapping update the raw 'HID Codes' would effectively encode the position of a key as there's only one place where that code could possibly point to. Now, the remapping allows for those keys to be anywhere (and potentially in multiple places) so we've lost the position information of keys.
To solve this there's the possibility of including the Row/Column information of the key following the keyboard matrix, to encode the key position.
The question is, how this should be implemented, with there being two main approaches:
The text was updated successfully, but these errors were encountered: