Atmega32U4 LUFA Keyboard Media Keys.

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I am trying to get a button to act as a play/pause media button using the Keyboard.c LUFA examples but with no luck. I have gotten it to work with other regular key scan codes, however.

Do I need to change any report items in HIDClassCommon.h? My code snippet is below. I have left the report descriptor unchanged.

media_button = (PIND >> PIND6) & 1; // Read media button pin
	
	if (media_button == 0) { // Active low
		KeyboardReport->KeyCode[0] = HID_KEYBOARD_SC_MEDIA_PLAY;
	}

Thank you.