package sivantoledo.nxt.keyboard;

import sivantoledo.nxt.Log;
import sivantoledo.nxt.NXTender;
import sivantoledo.nxt.Sender;
import sivantoledo.nxt.NXTender.Plugin;

public class Keyboard extends NXTender.Plugin {
  
  private Keyboard() {
    super("PCKBD");
  }
  
  public void close() {
  }

  public void process(String command) {
    String key = command.substring(6);
    Log.println("kbd command <"+key+">");
    sivantoledo.win32.SendInput.keyDownUp("VK_"+key);
  }

  private static Keyboard instance;  
  public static Keyboard getInstance(Sender sender) {
    if (instance == null) instance = new Keyboard();
    return instance;
  }
  
}
