Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_keyboard.c:
static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, int rate, int delay) {
- FIXME("rate=%d delay=%d stub!\n", rate, delay);
- UINT speed;
- TRACE("rate=%d delay=%d\n", rate, delay);
- /* Handle non-negative rate values, ignore invalid (negative) values. A
* rate of 0 disables repeat. */
- if (rate >= 80) speed = 31;
- else if (rate >= 5) speed = rate * 400 / 1000 - 1;
- else speed = 0;
- NtUserSystemParametersInfo(SPI_SETKEYBOARDSPEED, speed, NULL, 0);
- NtUserSystemParametersInfo(SPI_SETKEYBOARDDELAY, max(0, min(3, delay / 250)), NULL, 0);
I would (personally) prefer to have a calculation that rounded to the closest 250ms step, e.g., `max(0, min(3, round(delay / 250.0) - 1))`. This would help avoid reduce large positive delay diffs (e.g., with the current formula a 250ms Wayland delay becomes SPI delay 1 => 500ms), with the trade-off being that it can lead to (smaller) negative diffs.
Other than this somewhat subjective concern, the MR looks good.