Modifier key and multiple letters

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
imagiro1
Posts: 4
Joined: Thu Jan 10, 2013 10:39 pm

Modifier key and multiple letters

Post by imagiro1 » Sun Jan 13, 2013 1:41 am

I have built the a circuit and compiled a simple keyboard code on an ATmega168. I have two questions.
1. How do I use the modifier keys? For example, I want to send Win+L to lock the screen. Here is part of the code I currently have.

Code: Select all

case '@':
            keyboard_report.modifier = _BV(1); // hold shift
            keyboard_report.keycode[0] = 29 + 2;
            break;

What would I put instead of the @ and where do I find the equivalent of "hold shift"
2. Is it possible to send a string? The example I am working with only sends one letter at a time. I could put the chars in an array, but I was hoping I could use a string. Is there an example for this?

Thanks in advance.

Post Reply