Due KeyboardController keypress for "Enter" key sent over an IC2 link

Greetings,

The goal is to permit a USB barcode scanner to scan once and send to two PCs for the same scan. I’ve been able to build the IC2 link between 1 x Arduino Due and 2x Micro Pro Arduino controllers.

The Due has the barcode scanner attached and sends the relevant data over the IC2 link to the 2 Micro Pro controllers that emulate a usb keyboard and send the output to two computers. The only issue is I can’t get the non-character key input from the keyboard to properly traverse the IC2 link and decode an ENTER or CRLF.

When I attach the serial console to the slave IC2 I can see that it either sends “19” as and int or “J” as a character. I’ve tried using the keyboard.getmodifiers as well, but it’s having the same result over the IC2 bus.
No “enter” or CRLF sends on the keyboard output. I’ve even tried on the slave IC2 to say if “19” or “J” then send a Keyboard.print(0xB0); Still can’t get the “enter” key translation over the IC2 bus. Any help would be greatly appreciated.

I stripped down the code to the basics as things I’ve tried didn’t seem to help and I didn’t want to confuse the issue.

In the SLAVE MicroPro I left the IF statements to since the serial bus show “19” and “J” in serial but no return in the keyboard.wire. I even tried to use the int on the C output. This still had the same result.

DUE code:

#include <Wire.h>
#include <KeyboardController.h>
USBHost usb;
KeyboardController keyboard(usb);

int inboundsource = 0;

void setup() {
Wire.begin(); // join i2c bus

Serial.begin(115200); //Uncomment to Debug keyboard input to serial monitor.

}

void loop() {

usb.Task();
}
void keyPressed() {

inboundsource = keyboard.getKey();
// if (incomingByte = ‘’) {
// inboundsource == ‘’;

// }

Wire.beginTransmission(8); // send device #8
Serial.print(inboundsource); // uncomment to debug serial
Wire.write(inboundsource);
Wire.endTransmission(); // stop
delay(5);
}

MicroPro Code:
#include <Wire.h>
#include <Keyboard.h>

void setup() {
Wire.begin(8);
Wire.onReceive(receiveEvent);
Keyboard.begin();
Serial.begin(115200); // start serial for output
}

void loop() {
delay(5);
}

void receiveEvent(int howMany) {

char c = Wire.read(); // receive byte as a character

//if (c = 19)
// {
// Keyboard.write(0xB0);
// }

// Serial.print(c); // print the character
if (c == ‘J’) {
Keyboard.print(0xB0);
}
else
{

Serial.print((int)c, ‘!’);
Keyboard.print(c);
}

}

Again any assistance is greatly appreciated.

  Serial.print((int)c, '!');

The second argument to print() is the base to print the number in. What the hell base is '!'?

  Keyboard.print(0xB0);

What the heck is that supposed to print? ASCII values are in the range -128 to 127 (although there are no negative values actually used).

Serial.print((int)c, '!');

Will print it as an integer to the serial console.

Keyboard.print(0xB0);

Will write a HEX output to the computer that = ENTER