Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-21 15:13:05 +01:00
parent f2d952b743
commit 3ecd57d1b2
475 changed files with 37130 additions and 2 deletions

View file

@ -0,0 +1,33 @@
package juloo.keyboard2;
import java.lang.reflect.Array;
import java.util.Map;
import java.util.TreeMap;
/** Stores key combinations that are applied by [KeyModifier]. */
public final class Modmap
{
public enum M { Shift, Fn, Ctrl }
Map<KeyValue, KeyValue>[] _map;
public Modmap()
{
_map = (Map<KeyValue, KeyValue>[])Array.newInstance(TreeMap.class,
M.values().length);
}
public void add(M m, KeyValue a, KeyValue b)
{
int i = m.ordinal();
if (_map[i] == null)
_map[i] = new TreeMap<KeyValue, KeyValue>();
_map[i].put(a, b);
}
public KeyValue get(M m, KeyValue a)
{
Map<KeyValue, KeyValue> mm = _map[m.ordinal()];
return (mm == null) ? null : mm.get(a);
}
}