B4R Library [code modules] Keyboard, Mouse, etc...

Discussion in 'B4R Libraries' started by Roycefer, Mar 17, 2017.

  1. Roycefer

    Roycefer Well-Known Member Licensed User

    In the attached .zip is a project that includes and demonstrates the use of three code modules. Keyboard.bas and Mouse.bas wrap the Arduino Keyboard and Mouse libraries using their own syntax.

    Reference: https://www.arduino.cc/en/Reference/MouseKeyboard

    There is also a Robo.bas module that uses the same syntax as the jAWTRobot library. This enables you to use the jAWTRobot library in B4J to test out code before pasting it into a B4R project.

    This library works only on boards that don't use a dedicated USB-Serial chip (like an FTDI chip or a CH340). The Leonardo and the Pro Micro are examples of boards where the main processor also provides USB functionality. These boards can make use of these code modules.
     

    Attached Files:

    Mostez and Erel like this.
  2. Mostez

    Mostez Active Member

    very good work, I was looking for this for long time, thanks
     
  3. Mostez

    Mostez Active Member

    Hello,
    I've tried the code and it works ok, just wanted to ask if it's possible to control character sending speed! because I use leonardo to emulate keyboard, the software on PC performs text check every time it receives a new character (textbox text changed event) I want to allow PC to finish text check before receiving next character.

    for now, I used delay inside for next loop,
    Code:
    For m = 0 To 9
            Keyboard.Write2 (Arr(m))
            Delay(
    10)
        
    Next
     
  4. Roycefer

    Roycefer Well-Known Member Licensed User

    If the Delay call doesn't interfere with other tasks like receiving Serial data then you can just stick with the Delay calls. If you want something that doesn't block, you can try using CallSubPlus or a Timer. But this is more about program flow than it is about the KeyboardMouse library. The library just sends the keystrokes at the speed at which the code is executed.
     
  5. Mostez

    Mostez Active Member

Loading...