diff --git a/app/src/main/assets/keymaps/pl.layout b/app/src/main/assets/keymaps/pl.layout new file mode 100644 index 00000000..62495302 --- /dev/null +++ b/app/src/main/assets/keymaps/pl.layout @@ -0,0 +1,92 @@ +## Keymap overlay for a Polish Programmer keyboard + +## ------------------------- +## SOME USEFUL INFORMATIONS +## ------------------------- +## ... for everyone who, just like me (winlin97), had no idea how it works, and want to make a custom keyboard layout. +## ------------------------- +## The PC (thanks to the HID interface) see this application just like the physical keyboard. +## Application does not know the actual layout of the keyboard in the system. +## We must to call the language-appropriate characters just as if we were typing them on a physical keyboard with this layout. +## ------------------------- +## This file contains a table of key mapping. +## Column order in the table: CHAR <-SPACE-> HID_KEY_SCANCODE <-SPACE-> MODIFIERS +## ------------------------- +## <-SPACE-> is only a representation for spacebar (" " char), which is used by the program to separate individual values from every line in the table. +## ------------------------- +## CHAR is just the letter, number or character, which we have to send to the computer. +## ------------------------- +## HID_KEY_SCANCODE is a byte value, which corresponds to every key on the keyboard. +## Firstly you can look at "base.layout" file to see what scancode is e.g. for "numbers and letters" +## Important: "base.layout" is used with every custom layout. We don't have to add the chars to our table that this file already contains. +## More scancodes -> https://source.android.com/docs/core/interaction/input/keyboard-devices#hid-keyboard-and-keypad-page-0x07 +## ------------------------- +## MODIFIERS such as LCTRL, LSHIFT, LALT, etc. can be combined using the “or” (|) bit operation. +## The modifier value is stored using 1 byte [8 bits] - that allows to combine modifiers, setting the corresponding bits to 1. +## Each modifier corresponds to one bit in the byte, so no bits overlap. +## 00: none [bit: 0000 0000] // DEFAULT VALUE - all modifiers is off +## 01: LCTRL [bit: 0000 0001] +## 02: LSHIFT [bit: 0000 0010] +## 04: LALT [bit: 0000 0100] +## 08: LMETA [bit: 0000 1000] +## 10: RCTRL [bit: 0001 0000] +## 20: RSHIFT [bit: 0010 0000] +## 40: RALT [bit: 0100 0000] // "ALTGR" in polish programmers layout -> https://kbdlayout.info/KBDPL1/ +## 80: RMETA [bit: 1000 0000] +## So, to get RALT and LSHIFT in the same time we have: 0x40 | 0x02 -> [bit: 0100 0010] -> 0x42 +## ------------------------- +## More info -> https://source.android.com/docs/core/interaction/input/keyboard-devices +## ------------------------- + +## START OF THE RIGHT TABLE: +ą 04 40 +ć 06 40 +ę 08 40 +ł 0F 40 +ń 11 40 +ó 12 40 +ś 16 40 +ź 1B 40 +ż 1D 40 + +Ą 04 42 +Ć 06 42 +Ę 08 42 +Ł 0F 42 +Ń 11 42 +Ó 12 42 +Ś 16 42 +Ź 1B 42 +Ż 1D 42 + +| 31 02 +? 38 02 +< 36 02 +> 37 02 +: 33 02 +" 34 02 +{ 2F 02 +} 30 02 + +\ 31 00 +/ 38 00 +, 36 00 +. 37 00 +; 33 00 +' 34 00 +[ 2F 00 +] 30 00 + +! 1E 02 +@ 1F 02 +# 20 02 +$ 21 02 +% 22 02 +^ 23 02 +& 24 02 +* 25 02 +( 26 02 +) 27 02 +_ 2D 02 ++ 2E 02 +~ 35 02 diff --git a/app/src/main/java/dev/fabik/bluetoothhid/bt/BluetoothController.kt b/app/src/main/java/dev/fabik/bluetoothhid/bt/BluetoothController.kt index 94fdc09c..816aded3 100644 --- a/app/src/main/java/dev/fabik/bluetoothhid/bt/BluetoothController.kt +++ b/app/src/main/java/dev/fabik/bluetoothhid/bt/BluetoothController.kt @@ -295,6 +295,7 @@ class BluetoothController(var context: Context) { 4 -> "es" 5 -> "it" 6 -> "tr" + 7 -> "pl" else -> "us" }, template, diff --git a/app/src/main/java/dev/fabik/bluetoothhid/bt/KeyTranslator.kt b/app/src/main/java/dev/fabik/bluetoothhid/bt/KeyTranslator.kt index 12a7a2af..28a065d9 100644 --- a/app/src/main/java/dev/fabik/bluetoothhid/bt/KeyTranslator.kt +++ b/app/src/main/java/dev/fabik/bluetoothhid/bt/KeyTranslator.kt @@ -73,6 +73,24 @@ class KeyTranslator(context: Context) { staticTemplates["DOWN"] = Key(0, 0x51) staticTemplates["UP"] = Key(0, 0x52) +// winlin97: added unused function keys for special usage +// F1-F12 are binded in many Windows apps - also in Explorer +// Now You can write an external app that can recognize this keys +// as a triggers (StartKey -> Barcode -> StopKey), +// without any unexpected interactions with the system. + staticTemplates["F13"] = Key(0, 0x68) + staticTemplates["F14"] = Key(0, 0x69) + staticTemplates["F15"] = Key(0, 0x6a) + staticTemplates["F16"] = Key(0, 0x6b) + staticTemplates["F17"] = Key(0, 0x6c) + staticTemplates["F18"] = Key(0, 0x6d) + staticTemplates["F19"] = Key(0, 0x6e) + staticTemplates["F20"] = Key(0, 0x6f) + staticTemplates["F21"] = Key(0, 0x70) + staticTemplates["F22"] = Key(0, 0x71) + staticTemplates["F23"] = Key(0, 0x72) + staticTemplates["F24"] = Key(0, 0x73) + val dateFormat = DateFormat.getDateInstance(DateFormat.SHORT) val timeFormat = DateFormat.getTimeInstance() diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 7fdef20a..fa2ac6e8 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -157,6 +157,7 @@ Spanisch (ES) Italienisch (IT) Türkisch Q (TR) + Polnische Programmierer (PL) Box @@ -191,7 +192,7 @@ Eigenes Template Erlaubt ein eigenes Template festzulegen - Stellen Sie sicher, dass \'Extra Tasten\' auf \'Benutzerdefiniert\' eingestellt ist. Spezielle Platzhalter: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–12}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (code ist erforderlich)\n + Stellen Sie sicher, dass \'Extra Tasten\' auf \'Benutzerdefiniert\' eingestellt ist. Spezielle Platzhalter: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–24}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (code ist erforderlich)\n Kombinationen können mit den folgenen Zeichen verwendet werden:\n \t^: Shift\n \t+: Ctrl\n @@ -257,4 +258,4 @@ Ersetzt Templates aus dem Code-Wert (Benötigt benutzerdefiniertes Template) Fehler bei der Verbindung mit dem Gerät! Starte service neu… Entwicklermodus - \ No newline at end of file + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 48868be3..c0a12df6 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -23,13 +23,13 @@ Określ kształt ramki Cały kod w ramce Kody kreskowe muszą być w pełni widoczne w obszarze ramki - Częstotliwość skanowania + Częstość skanowania Interwał, w którym analizowany jest obraz. Wyższa częstotliwość = wyższe wykorzystanie procesora. - Rozdzielczość skanowania + Rozdzielczość skanera Rozdzielczość analizowanego obrazu. Wyższa rozdzielczość = dłuższy czas analizy. Auto-wysyłanie Automatycznie wysyłaj wszystkie wykryte kody - Extra klawisze + Ekstra klawisze Określa, który klawisz ma być dołączany na końcu każdego wysyłanego tekstu Dźwięk skanowania Odtwórz dźwięk podczas skanowania kodu @@ -138,7 +138,7 @@ Własny szablon Umożliwia ustawienie niestandardowego szablonu - Upewnij się, że ustawiłeś \'Ekstra klawisze\' na \'Własny szablon\'. Specjalne znaczniki: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–12}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (znacznik CODE jest wymagany)\n + Upewnij się, że ustawiłeś \'Ekstra klawisze\' na \'Własny szablon\'. Specjalne znaczniki: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–24}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (znacznik CODE jest wymagany)\n Modyfikatory mogą być ustawione poprzez dodanie następujących znaków:\n \t^: Shift\n \t+: Ctrl\n @@ -203,10 +203,10 @@ Prostokątna (Kody kreskowe) - Najszybsze - Szybkie (100ms) - Normalne (500ms) - Wolne (1s) + Najszybciej + Szybko (100ms) + Normalnie (500ms) + Wolno (1s) SD (480P) @@ -244,6 +244,7 @@ Hiszpański (ES) Włoski (IT) Turecki Q (TR) + Polski Programisty (PL) Ramka diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 30e1ed41..0a46e13e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -137,7 +137,7 @@ Custom template Allows you to set a custom template - Make sure to set \'Extra keys\' to \'Custom\'. Special placeholders: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–12}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (code is required)\n + Make sure to set \'Extra keys\' to \'Custom\'. Special placeholders: {CODE}, {CODE_B64}, {CODE_HEX}, {F1–24}, {ENTER}, {ESC}, {TAB}, {BKSP}, {DATE}, {TIME}, {LEFT}, {RIGHT}, {UP}, {DOWN} (code is required)\n Modifiers can be set by prepending the following chars:\n \t^: Shift\n \t+: Ctrl\n @@ -243,6 +243,7 @@ Spanish (ES) Italian (IT) Turkish Q (TR) + Polish Programmer (PL) Box @@ -260,4 +261,4 @@ Export %1$d item Export %1$d items - \ No newline at end of file +