private void OnCharUp(GP.USBHost.USBH_Keyboard kb, GP.USBHost.USBH_KeyboardEventArgs e) { Debug.Print("char up: " + e.KeyAscii); if (e.KeyAscii == '\n') { Debug.Print("LF"); currentLine += 1; lines.Add(""); } else if (e.KeyAscii == '\r') { Debug.Print("suppressing CR"); } else { string s = (string)lines[currentLine]; s += e.KeyAscii; lines[currentLine] = s; } display_T35.SimpleGraphics.ClearNoRedraw(); int lineSpacing = font.Height; for (int i = 0; i < lines.Count; i++) { display_T35.SimpleGraphics.DisplayText((string)lines[i], font, Color.White, 0, (uint)(i * lineSpacing)); } }
private void OnKeyboardConnected(GTM.GHIElectronics.UsbHost host, GP.USBHost.USBH_Keyboard kb) { Debug.Print("keyboard connected"); kb.CharUp += OnCharUp; }