CodeCraft icon indicating copy to clipboard operation
CodeCraft copied to clipboard

Add HID/USB CLIENT library to Codecraft

Open vongomben opened this issue 2 years ago • 8 comments

It would be really cool to have the keyboard and mouse functionalities brought to Codecraft

https://wiki.seeedstudio.com/Wio-Terminal-USBCLIENT-Keyboard/

vongomben avatar Jan 21 '24 16:01 vongomben

These three commands corresponds to the three different Mouse.click Link to documentation

#include <Mouse.h>

void setup() {

  Mouse.begin();
}

void loop() {

    Mouse.click(MOUSE_LEFT);
    Mouse.click(MOUSE_RIGHT);
    Mouse.click(MOUSE_MIDDLE);
  }
}

MouseClick

vongomben avatar Jan 22 '24 15:01 vongomben

These three commands corresponds to the three different Mouse.press() The latter acts as Mouse.release()

MousePressed

MouseReleased

#include <Mouse.h>

void setup() {

  Mouse.begin();
}

void loop() {

  
    Mouse.press(MOUSE_LEFT);
    Mouse.press(MOUSE_RIGHT);
    Mouse.press(MOUSE_MIDDLE);

    Mouse.release();
  
}


vongomben avatar Jan 22 '24 15:01 vongomben

Mouse movement control link to documentation

Mouse.move(xVal, yVal, wheel)

Parameters xVal: amount to move along the x-axis. Allowed data types: signed char. yVal: amount to move along the y-axis. Allowed data types: signed char. wheel: amount to move scroll wheel. Allowed data types: signed char.

mousemove

vongomben avatar Jan 22 '24 16:01 vongomben

Mouse.isPressed

Reports whether a button is pressed or not. Data type: bool.

mouseCondition

Mouse.end()

MouseClosed

vongomben avatar Jan 22 '24 16:01 vongomben

Press a Specific Charaacter on the Keyboad, then release it as in [Keyboard.write()] KeyboardWrite

#include <Keyboard.h>

void setup() {
 
  Keyboard.begin();
}

void loop() {

    Keyboard.write(character);
  }
}

vongomben avatar Jan 22 '24 16:01 vongomben

More Keyboard functions:

Keyboard.press()

Keyboard.press(key)

KeyboardPress


Keyboard.release()

Keyboard.release(key)

KeyboardRelease


Keyboard.releaseAll()

KeyboardReleaseAll

vongomben avatar Jan 22 '24 16:01 vongomben

Keyboard.end()

Keyboardclosed

vongomben avatar Jan 22 '24 16:01 vongomben

Most important Keyboard.print() and Keyboard.println() the most useful one to write as in a keyboard. KeyboardPintln

KeyboardPrint

vongomben avatar Jan 22 '24 16:01 vongomben