1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winex11.drv: Improve DetectLayout heuristics.

Dvorak detection would sometimes fallback to Phantom keys, because we
only use seq as a tie breaker greater emphasis on locality is required
for layouts using the same language.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
This commit is contained in:
Daniel Hill 2024-01-18 20:35:13 +13:00 committed by Alexandre Julliard
parent 4fb14b5656
commit b5359b7da0

View file

@ -1522,8 +1522,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display )
}
TRACE("matches=%d, mismatches=%d, seq=%d, score=%d\n",
match, mismatch, seq, score);
if ((score > max_score) ||
((score == max_score) && (seq > max_seq))) {
if (score + (int)seq > max_score + (int)max_seq) {
/* best match so far */
kbd_layout = current;
max_score = score;