mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-21 23:03:11 +01:00
Use preferred dir when placing a key next to an other
This commit is contained in:
parent
773147ab9c
commit
944ed32a37
@ -67,8 +67,14 @@ public final class KeyboardData
|
||||
if (pos.next_to != null)
|
||||
{
|
||||
KeyPos next_to_pos = getKeys().get(pos.next_to);
|
||||
if (next_to_pos != null
|
||||
&& add_key_to_pos(rows, kv, next_to_pos.with_dir(-1)))
|
||||
// Use preferred direction if some preferred pos match
|
||||
if (next_to_pos != null)
|
||||
for (KeyPos p : pos.positions)
|
||||
if ((p.row == -1 || p.row == next_to_pos.row)
|
||||
&& (p.col == -1 || p.col == next_to_pos.col)
|
||||
&& add_key_to_pos(rows, kv, next_to_pos.with_dir(p.dir)))
|
||||
return true;
|
||||
if (add_key_to_pos(rows, kv, next_to_pos.with_dir(-1)))
|
||||
return true;
|
||||
}
|
||||
for (KeyPos p : pos.positions)
|
||||
|
Loading…
Reference in New Issue
Block a user