Probleme conversion qwerty/azerty
Fermé
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
-
Modifié par fatma22 le 10/09/2014 à 19:09
Toadst Messages postés 1 Date d'inscription samedi 20 mars 2021 Statut Membre Dernière intervention 20 mars 2021 - 20 mars 2021 à 20:26
Toadst Messages postés 1 Date d'inscription samedi 20 mars 2021 Statut Membre Dernière intervention 20 mars 2021 - 20 mars 2021 à 20:26
A voir également:
- Qwerty en azerty convertisseur
- Changer clavier qwerty en azerty - Guide
- Convertisseur mp3 pc - Télécharger - Conversion & Extraction
- Convertisseur youtube mp3 - Guide
- Convertisseur note sur 20 ✓ - Forum Bureautique
- Probléme avec Convertisseur youtube mp3 ✓ - Forum YouTube
12 réponses
fiddy
Messages postés
11069
Date d'inscription
samedi 5 mai 2007
Statut
Contributeur
Dernière intervention
23 avril 2022
1 816
10 sept. 2014 à 23:32
10 sept. 2014 à 23:32
Bonjour,
Le problème vient de la bibliothèque Keyboard qui se base sur un clavier américain.
Il faut donc redéfinir la variable _asciimap dans le fichier HID.c et mettre :
Cdlt,
Le problème vient de la bibliothèque Keyboard qui se base sur un clavier américain.
Il faut donc redéfinir la variable _asciimap dans le fichier HID.c et mettre :
const uint8_t _asciimap[128] =
{
0x00, /* NUL */
0x00, /* SOH */
0x00, /* STX */
0x00, /* ETX */
0x00, /* EOT */
0x00, /* ENQ */
0x00, /* ACK */
0x00, /* BEL */
0x2a, /* BS Backspace */
0x2b, /* TAB Tab */
0x28, /* LF Enter */
0x00, /* VT */
0x00, /* FF */
0x00, /* CR */
0x00, /* SO */
0x00, /* SI */
0x00, /* DEL */
0x00, /* DC1 */
0x00, /* DC2 */
0x00, /* DC3 */
0x00, /* DC4 */
0x00, /* NAK */
0x00, /* SYN */
0x00, /* ETB */
0x00, /* CAN */
0x00, /* EM */
0x00, /* SUB */
0x00, /* ESC */
0x00, /* FS */
0x00, /* GS */
0x00, /* RS */
0x00, /* US */
0x2c, /* ' ' */
0x38, /* ! */
0x20, /* " */
0x20, /* # :TODO */
0x30, /* $ */
0x34|SHIFT, /* % */
0x1E, /* & */
0x21, /* ' */
0x22, /* ( */
0x2d, /* ) */
0x31, /* * : done */
0x2b|SHIFT, /* + */
0x10, /* , */
0x23, /* - */
0x36|SHIFT, /* . */
0x37|SHIFT, /* / */
0x27|SHIFT, /* 0 */
0x1e|SHIFT, /* 1 */
0x1f|SHIFT, /* 2 */
0x20|SHIFT, /* 3 */
0x21|SHIFT, /* 4 */
0x22|SHIFT, /* 5 */
0x23|SHIFT, /* 6 */
0x24|SHIFT, /* 7 */
0x25|SHIFT, /* 8 */
0x26|SHIFT, /* 9 */
0x37, /* : */
0x36, /* ; */
0x64, /* < Done */
0x2e, /* = */
0x64|SHIFT, /* > Done */
0x10|SHIFT, /* ? 0x38 -> 0x10 OK */
0x1f, /* @ TODO */
0x14|SHIFT, /* A */
0x05|SHIFT, /* B */
0x06|SHIFT, /* C */
0x07|SHIFT, /* D */
0x08|SHIFT, /* E */
0x09|SHIFT, /* F */
0x0a|SHIFT, /* G */
0x0b|SHIFT, /* H */
0x0c|SHIFT, /* I */
0x0d|SHIFT, /* J */
0x0e|SHIFT, /* K */
0x0f|SHIFT, /* L */
0x33|SHIFT, /* M */
0x11|SHIFT, /* N */
0x12|SHIFT, /* O */
0x13|SHIFT, /* P */
0x04|SHIFT, /* Q */
0x15|SHIFT, /* R */
0x16|SHIFT, /* S */
0x17|SHIFT, /* T */
0x18|SHIFT, /* U */
0x19|SHIFT, /* V */
0x1d|SHIFT, /* W */
0x1b|SHIFT, /* X */
0x1c|SHIFT, /* Y */
0x1a|SHIFT, /* Z */
0x0c, /* [ TODO 2F */
0x31, /* bslash */
0x0d, /* ] TODO 30 */
0x2F, /* ^ */
0x25, /* _ */
0x35, /* ' TODO */
0x14, /* a */
0x05, /* b */
0x06, /* c */
0x07, /* d */
0x08, /* e */
0x09, /* f */
0x0a, /* g */
0x0b, /* h */
0x0c, /* i */
0x0d, /* j */
0x0e, /* k */
0x0f, /* l */
0x33, /* m */
0x11, /* n */
0x12, /* o */
0x13, /* p */
0x04, /* q */
0x15, /* r */
0x16, /* s */
0x17, /* t */
0x18, /* u */
0x19, /* v */
0x1d, /* w */
0x1b, /* x */
0x1c, /* y */
0x1a, /* z */
0x2f|SHIFT, /* */
0x31|SHIFT, /* | TODO */
0x30|SHIFT, /* } TODO */
0x35|SHIFT, /* ~ TODO */
0 /* DEL */
};
Cdlt,
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
10 sept. 2014 à 19:17
10 sept. 2014 à 19:17
voici une partie :
Keyboard.print("cmd"); il me donne ----> c;d
Keyboard.print("del abc.vbs"); il me donne ----> del abc:vbs
Keyboard.print("cmd"); il me donne ----> c;d
Keyboard.print("del abc.vbs"); il me donne ----> del abc:vbs
sambia39
Messages postés
610
Date d'inscription
vendredi 31 juillet 2009
Statut
Membre
Dernière intervention
9 février 2023
48
10 sept. 2014 à 18:56
10 sept. 2014 à 18:56
Bonsoir ,
Peut tu nous fournir ton code sources ? pour savoir d'où viens le problème ?
à bientôt
Peut tu nous fournir ton code sources ? pour savoir d'où viens le problème ?
à bientôt
sambia39
Messages postés
610
Date d'inscription
vendredi 31 juillet 2009
Statut
Membre
Dernière intervention
9 février 2023
48
10 sept. 2014 à 20:20
10 sept. 2014 à 20:20
Ok une partie nous avance en rien, il nous faut le une bonne partie de la sources pour comprendre
Exemple
à bientôt
Exemple
#include <stdio.h>
int main( void ){
unsigned int ret = 65;
printf( "%c\n", ret );
printf( "%c\n", ret - 32 );
return ( 0 );
}
à bientôt
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
10 sept. 2014 à 20:46
10 sept. 2014 à 20:46
J'ai cru que c'est suffisant ! voila:
#include "usb_private.h"
#include "usb_api.h"
#include <stdio.h>
#include <string.h>
int inPin = 3;
int ledPin = 11;
boolean fileCreated = false;
// Checks if the NUM is on
bool isNumLockOn() {
return bitRead(int(keyboard_leds), 0);
}
// Checks if the CAPS is on
bool isCapsLockOn() {
return bitRead(int(keyboard_leds), 1);
}
// Release the key
void sendNull() {
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
}
void PressAndRelease(int KeyCode,int KeyCount){
int KeyCounter=0;
for (KeyCounter=0; KeyCounter!=KeyCount; KeyCounter++){
Keyboard.set_key1(KeyCode); // use r key
Keyboard.send_now(); // send strokes
Keyboard.set_key1(0);
Keyboard.send_now(); // send strokes
}
}
void CommandAtRunBar(char *SomeCommand){
delay(80); // let buffer settle
bool cps_state=isCapsLockOn();
Keyboard.set_modifier(128); //Windows key
Keyboard.set_key1(KEY_R); // use r key
Keyboard.send_now(); // send strokes
sendNull();
delay(100);
if (cps_state) { // If caps lock is ON set it OFF
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(80); // let buffer settle
}
Keyboard.print(SomeCommand);
delay(50);
PressAndRelease(KEY_ENTER,1); // push ENTER
delay(50);
if (cps_state) { // If caps lock was ON set it back to ON
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(80); // let buffer settle
}
}
void setup(){
pinMode(inPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop(){
while (!usb_configuration) { // Wait for USB to be ready
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
}
if (digitalRead(inPin) && !fileCreated) {
bool initial_state=isCapsLockOn();
// create vbscript and run it
delay(300);
CommandAtRunBar("cmd");
delay(300);
if (initial_state) { // If caps lock is ON set it OFF
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(50); // let buffer settle
}
Keyboard.print("del nes.vbs");
PressAndRelease(KEY_ENTER,1); // push ENTER
Keyboard.print("copy con nes.vbs");
PressAndRelease(KEY_ENTER,1); // push ENTER
#include "usb_private.h"
#include "usb_api.h"
#include <stdio.h>
#include <string.h>
int inPin = 3;
int ledPin = 11;
boolean fileCreated = false;
// Checks if the NUM is on
bool isNumLockOn() {
return bitRead(int(keyboard_leds), 0);
}
// Checks if the CAPS is on
bool isCapsLockOn() {
return bitRead(int(keyboard_leds), 1);
}
// Release the key
void sendNull() {
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
}
void PressAndRelease(int KeyCode,int KeyCount){
int KeyCounter=0;
for (KeyCounter=0; KeyCounter!=KeyCount; KeyCounter++){
Keyboard.set_key1(KeyCode); // use r key
Keyboard.send_now(); // send strokes
Keyboard.set_key1(0);
Keyboard.send_now(); // send strokes
}
}
void CommandAtRunBar(char *SomeCommand){
delay(80); // let buffer settle
bool cps_state=isCapsLockOn();
Keyboard.set_modifier(128); //Windows key
Keyboard.set_key1(KEY_R); // use r key
Keyboard.send_now(); // send strokes
sendNull();
delay(100);
if (cps_state) { // If caps lock is ON set it OFF
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(80); // let buffer settle
}
Keyboard.print(SomeCommand);
delay(50);
PressAndRelease(KEY_ENTER,1); // push ENTER
delay(50);
if (cps_state) { // If caps lock was ON set it back to ON
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(80); // let buffer settle
}
}
void setup(){
pinMode(inPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop(){
while (!usb_configuration) { // Wait for USB to be ready
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
}
if (digitalRead(inPin) && !fileCreated) {
bool initial_state=isCapsLockOn();
// create vbscript and run it
delay(300);
CommandAtRunBar("cmd");
delay(300);
if (initial_state) { // If caps lock is ON set it OFF
PressAndRelease(KEY_CAPS_LOCK,1); // push caps lock
delay(50); // let buffer settle
}
Keyboard.print("del nes.vbs");
PressAndRelease(KEY_ENTER,1); // push ENTER
Keyboard.print("copy con nes.vbs");
PressAndRelease(KEY_ENTER,1); // push ENTER
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
10 sept. 2014 à 20:47
10 sept. 2014 à 20:47
en fait , le probleme reside dans les dernieres lignes : keyboard.print , il est entrain de les lire en qwerty
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
11 sept. 2014 à 11:18
11 sept. 2014 à 11:18
merci , mais ou je peux trouver le fichier HID.c
fiddy
Messages postés
11069
Date d'inscription
samedi 5 mai 2007
Statut
Contributeur
Dernière intervention
23 avril 2022
1 816
11 sept. 2014 à 11:23
11 sept. 2014 à 11:23
Ben, il y a la fonction recherche sous Windows...
Cela dépend où tu as installé ces fichiers. Peut-être un truc du genre : Program Files\arduino\hardware\arduino\cores\arduino
Cela dépend où tu as installé ces fichiers. Peut-être un truc du genre : Program Files\arduino\hardware\arduino\cores\arduino
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
11 sept. 2014 à 11:59
11 sept. 2014 à 11:59
oui je l'ai déjà trouvé merci
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
11 sept. 2014 à 12:25
11 sept. 2014 à 12:25
j'ai fait comme a dit fiddy mais rien n'est changé , dois-je declarer une variable ou une bibliotheque dans mon code ?
fiddy
Messages postés
11069
Date d'inscription
samedi 5 mai 2007
Statut
Contributeur
Dernière intervention
23 avril 2022
1 816
Modifié par fiddy le 11/09/2014 à 22:54
Modifié par fiddy le 11/09/2014 à 22:54
As-tu bien utilisé Keyboard.begin() ?
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
12 sept. 2014 à 11:54
12 sept. 2014 à 11:54
oui
Inconnu1234
Messages postés
383
Date d'inscription
mardi 16 juillet 2013
Statut
Membre
Dernière intervention
21 août 2018
14
Modifié par Inconnu1234 le 10/09/2014 à 18:34
Modifié par Inconnu1234 le 10/09/2014 à 18:34
Tu as un Windows , androïd , mac , ios , linux ??
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
10 sept. 2014 à 18:36
10 sept. 2014 à 18:36
windows , je m'excuse de ne pas avoir mentionner cela
Inconnu1234
Messages postés
383
Date d'inscription
mardi 16 juillet 2013
Statut
Membre
Dernière intervention
21 août 2018
14
10 sept. 2014 à 18:43
10 sept. 2014 à 18:43
C'est un windows 8 ?
fatma22
Messages postés
14
Date d'inscription
vendredi 13 septembre 2013
Statut
Membre
Dernière intervention
12 septembre 2014
10 sept. 2014 à 18:46
10 sept. 2014 à 18:46
windows7
Inconnu1234
Messages postés
383
Date d'inscription
mardi 16 juillet 2013
Statut
Membre
Dernière intervention
21 août 2018
14
10 sept. 2014 à 18:47
10 sept. 2014 à 18:47
11 sept. 2014 à 11:27
peut-être que je me trompe mais pour la keymap que ta fournie en ASCII, il n'est pas préférable de définir comme ceci ?
Vue que Arduino ce base sur les table ASCII
à bientôt
Modifié par fiddy le 11/09/2014 à 11:47
Je pense que tu confonds le scancode avec l'ascii code...
Les 0x01, ... que tu vois ici ne sont pas les codes ascii. Donc, non, il ne faut pas faire ainsi :-).
11 sept. 2014 à 12:19
+1
à bientôt
20 mars 2021 à 20:26