Keyboard not working

code:
Keyboard.print("shutdown -s -t 0001");
output:
shutdown 's 't 0001

Also " and : not print.

PLS HELP ME!

Usually these sorts of issues are caused by you using a different keyboard layout than the Keyboard library is written for.

I think for the English one.Anyway how i change the layout?

Anyway how i change the layout?

Just like you change any other code. Fire up a test editor and start typing.

code:
Keyboard.write('-'); OUTPUT: "
How i resolve this?

The problem is in the code you didn't post.

Also, please explain more what you want to do. This isn't Google. You are allowed to write entire paragraphs.

MorganS:
The problem is in the code you didn’t post.

Also, please explain more what you want to do. This isn’t Google. You are allowed to write entire paragraphs.

Code:

#include <Arduino.h>
#include <HID-Project.h>

void setup() {
    // put your setup code here, to run once:
  Serial.begin(9600);
  Keyboard.begin();
  while(!Serial) {}
}

void loop() {
    // put your main code here, to run repeatedly:
  Keyboard.println("shutdown -s");
  Keyboard.write('-');
  while(1) {}
}

the output is always ’ instead of -

i make 2 hours for find a resolution at the problem but it’s impossible to resolve

OK, more helpful. I’ve never used that library, so I don’t have an instant solution.

So what EXACTLY is printed to your screen?

Are there any other characters sent incorrectly? Maybe you can explore what else might be wrong.

Which keyboard layout are you using on your PC? The Keyboard class defaults to an American keyboard.

MorganS:
OK, more helpful. I've never used that library, so I don't have an instant solution.

So what EXACTLY is printed to your screen?

Are there any other characters sent incorrectly? Maybe you can explore what else might be wrong.

shutdown 's
's

PaulS:
Which keyboard layout are you using on your PC? The Keyboard class defaults to an American keyboard.

On my pc i use italian layout.
In fact I'm asking how to change layout, on Google i don't find the italian layout.

How i change layout?
Watch attachments

ASCII Map.txt (1.2 KB)

ImprovedKeylayouts.h (21.5 KB)

What you attached makes absolutely no sense at all! IF you want to change the relationship of the ASCII characters, use the numeric value of each and use some mathematical scheme to rearrange them.

Paul

You can help me at least to make me understand how I should do.
I would be really happy if you helped me why I should bring this thing together with a project with the school.
Thanks in advance.

Please provide more detail. I don't understand what you mean by "Change layout with ascii map ITA". I can't help you do something if I can't figure out what it is you are trying to do.

Threads merged.

johnwasser:
Please provide more detail. I don't understand what you mean by "Change layout with ascii map ITA". I can't help you do something if I can't figure out what it is you are trying to do.

If i print exclamation point for example,the output isn't him because on my pc i have active italian layout of keyboard and so the library have us international keyboard layout.
I want yo change from us international to italian layout.
Can you help me?

johnwasser:
Please provide more detail. I don't understand what you mean by "Change layout with ascii map ITA". I can't help you do something if I can't figure out what it is you are trying to do.

i'm trying to change layout from US international to italian because if, for example, i write: Keyboard.print("/"); the output isn't / but another symbol.

The lookup table is in libraries/Keyboard/src/Keyboard.cpp. The lookup table is '_asciimap'. The bottom 7 bits of each byte are the USB key code and the top bit is a flag saying whether the SHIFT key should be down.

Note that there is no place to put a flag for the AltGr shift so you can only type the two characters on the left side of each key.

You can find the USB key codes here:
http://www.usb.org/developers/hidpage/Hut1_12v2.pdf