Thanks again, Paul! I got it to work. I also had a lot of help from this page: http://forum.pjrc.com/archive/index.php/t-26024.html
I went a little beyond the basics and actually added a "Serial + Keyboard" option to the Arduino Tools > USB Type selection.
In case anyone else is trying to do this, here's exactly what I changed/added in 5 files:
Code:
diff ./hardware/teensy/boards.txt.org ./hardware/teensy/boards.txt
45a46,47
> teensy31.menu.usb.serialkeyboard.name=Serial + Keyboard
> teensy31.menu.usb.serialkeyboard.build.define0=-DUSB_SERIAL_KEYBOARD
Code:
diff ./hardware/teensy/cores/teensy3/usb_inst.cpp.org ./hardware/teensy/cores/teensy3/usb_inst.cpp
46a47,51
> #ifdef USB_SERIAL_KEYBOARD
> usb_serial_class Serial;
> usb_keyboard_class Keyboard;
> #endif
>
73c78
< #if defined(USB_SERIAL) || defined(USB_SERIAL_HID)
---
> #if defined(USB_SERIAL) || defined(USB_SERIAL_HID) || defined(USB_SERIAL_KEYBOARD)
Code:
diff ./hardware/teensy/cores/teensy3/usb_keyboard.h.org ./hardware/teensy/cores/teensy3/usb_keyboard.h
36c36
< #if defined(USB_HID) || defined(USB_SERIAL_HID)
---
> #if defined(USB_HID) || defined(USB_SERIAL_HID) || defined(USB_SERIAL_KEYBOARD)
Code:
diff ./hardware/teensy/cores/teensy3/usb_serial.h.org ./hardware/teensy/cores/teensy3/usb_serial.h
34c34
< #if defined(USB_SERIAL) || defined(USB_SERIAL_HID)
---
> #if defined(USB_SERIAL) || defined(USB_SERIAL_HID) || defined(USB_SERIAL_KEYBOARD)
Added to hardware/teensy/cores/teensy3/usb_desc.h:
Code:
#elif defined(USB_SERIAL_KEYBOARD)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0489
#define DEVICE_CLASS 0xEF
#define DEVICE_SUBCLASS 0x02
#define DEVICE_PROTOCOL 0x01
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d'}
#define PRODUCT_NAME_LEN 15
#define EP0_SIZE 64
#define NUM_ENDPOINTS 4
#define NUM_USB_BUFFERS 30
#define NUM_INTERFACE 3
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 4
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE 64
#define CDC_TX_SIZE 64
#define KEYBOARD_INTERFACE 2 // Keyboard
#define KEYBOARD_ENDPOINT 1
#define KEYBOARD_SIZE 8
#define KEYBOARD_INTERVAL 1
#define KEYBOARD_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9)
#define CONFIG_DESC_SIZE (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7)
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY