All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.moaxcp.x11client.protocol.xproto.KeyButMask Maven / Gradle / Ivy

There is a newer version: 0.18.2
Show newest version
package com.github.moaxcp.x11client.protocol.xproto;

import com.github.moaxcp.x11client.protocol.IntValue;
import java.lang.Integer;
import java.lang.Override;
import java.util.HashMap;
import java.util.Map;

public enum KeyButMask implements IntValue {
  SHIFT(0b1),

  LOCK(0b10),

  CONTROL(0b100),

  MOD1(0b1000),

  MOD2(0b10000),

  MOD3(0b100000),

  MOD4(0b1000000),

  MOD5(0b10000000),

  BUTTON1(0b100000000),

  BUTTON2(0b1000000000),

  BUTTON3(0b10000000000),

  BUTTON4(0b100000000000),

  BUTTON5(0b1000000000000);

  static final Map byCode = new HashMap<>();

  static {
    for(KeyButMask e : values()) {
        byCode.put(e.value, e);
    }
  }

  private int value;

  KeyButMask(int value) {
    this.value = value;
  }

  @Override
  public int getValue() {
    return value;
  }

  public static KeyButMask getByCode(int code) {
    return byCode.get(code);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy