Add the capslock key

The key enable caps lock immediately. It does nothing if caps lock is
already enabled.

It is not present on the keyboard by default but a place is defined on
every layout, top-right of the shift key. It can be enabled in the
settings.

The icon is from materialdesignicons.com.
This commit is contained in:
Jules Aguillon
2022-10-23 21:34:05 +02:00
parent 55cece7965
commit 36e10a792f
32 changed files with 50 additions and 33 deletions

View File

@@ -100,12 +100,12 @@ public class Keyboard2View extends View
}
/** Called by auto-capitalisation. */
public void set_shift_state(boolean state)
public void set_shift_state(boolean state, boolean lock)
{
if (_keyboard == null || _shift_key == null)
return;
if (state)
_pointers.add_fake_pointer(_shift_kv, _shift_key);
_pointers.add_fake_pointer(_shift_kv, _shift_key, lock);
else
_pointers.remove_fake_pointer(_shift_kv, _shift_key);
invalidate();