浏览代码

keyboard raw key: add test in Test.ino

main
plugz 4 年前
父节点
当前提交
1911a2144a
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. +14
    -0
      examples/Test/Test/Test.ino

+ 14
- 0
examples/Test/Test/Test.ino 查看文件

@@ -18,6 +18,8 @@ void setup()
Serial.println("USB Host Testing");
myusb.begin();
keyboard1.attachPress(OnPress);
keyboard1.attachRawPress(OnRawPress);
keyboard1.attachRawRelease(OnRawRelease);
keyboard2.attachPress(OnPress);
midi1.setHandleNoteOff(OnNoteOff);
midi1.setHandleNoteOn(OnNoteOn);
@@ -45,6 +47,18 @@ void OnPress(int key)
//Serial.println();
}

void OnRawPress(uint8_t keycode)
{
Serial.print("raw key press: ");
Serial.println((int)keycode);
}

void OnRawRelease(uint8_t keycode)
{
Serial.print("raw key release: ");
Serial.println((int)keycode);
}

void OnNoteOn(byte channel, byte note, byte velocity)
{
Serial.print("Note On, ch=");

正在加载...
取消
保存