ZKeyLEDPort.java
     1: //========================================================================================
     2: //  ZKeyLEDPort.java
     3: //    en:Z keyboard LED port
     4: //    ja:ZキーボードLEDポート
     5: //  Copyright (C) 2003-2023 Makoto Kamada
     6: //
     7: //  This file is part of the XEiJ (X68000 Emulator in Java).
     8: //  You can use, modify and redistribute the XEiJ if the conditions are met.
     9: //  Read the XEiJ License for more details.
    10: //  https://stdkmd.net/xeij/
    11: //========================================================================================
    12: 
    13: package xeij;
    14: 
    15: import java.io.*;
    16: 
    17: public final class ZKeyLEDPort implements AutoCloseable {
    18:   private boolean debugFlag;
    19:   public void setDebugFlag (boolean debugFlag) {
    20:     this.debugFlag = debugFlag;
    21:   }
    22:   private long handle;
    23:   @Override public native void close ();
    24:   public native void hitKey (int vk);
    25:   public native boolean isKeyPressed (int vk);
    26:   public native boolean isKeyToggled (int vk);
    27:   public native void open () throws IOException;
    28:   public native boolean send (long data);
    29:   public ZKeyLEDPort (boolean debugFlag) throws IOException {
    30:     this.debugFlag = debugFlag;
    31:     handle = 0L;
    32:     open ();
    33:   }
    34: }