Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-925: Add Russian keymap support "ru-ru-qwerty" #574

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/protocols/rdp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ rdp_keymaps = \
$(srcdir)/keymaps/pt_br_qwerty.keymap \
$(srcdir)/keymaps/pt_pt_qwerty.keymap \
$(srcdir)/keymaps/ro_ro_qwerty.keymap \
$(srcdir)/keymaps/ru_ru_qwerty.keymap \
$(srcdir)/keymaps/sv_se_qwerty.keymap \
$(srcdir)/keymaps/da_dk_qwerty.keymap \
$(srcdir)/keymaps/tr_tr_qwerty.keymap
Expand Down
62 changes: 62 additions & 0 deletions src/protocols/rdp/keymaps/ru_ru_qwerty.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

parent "base"
name "ru-ru-qwerty"
freerdp "KBD_RUSSIAN"

# Let's define the scan codes of the main Latin keys
#
map -caps -shift 0x10..0x1B 0x2B ~ "qwertyuiop[]\"
map -caps -shift 0x1E..0x28 ~ "asdfghjkl;'"
map -caps -shift 0x2C..0x35 ~ "zxcvbnm,./"

map -caps +shift 0x10..0x1B 0x2B ~ "QWERTYUIOP{}|"
map -caps +shift 0x1E..0x28 ~ "ASDFGHJKL:""
map -caps +shift 0x2C..0x35 ~ "ZXCVBNM<>?"

map +caps -shift 0x10..0x1B 0x2B ~ "QWERTYUIOP[]\"
map +caps -shift 0x1E..0x28 ~ "ASDFGHJKL;'"
map +caps -shift 0x2C..0x35 ~ "ZXCVBNM,./"

map +caps +shift 0x10..0x1B 0x2B ~ "qwertyuiop{}|"
map +caps +shift 0x1E..0x28 ~ "asdfghjkl:""
map +caps +shift 0x2C..0x35 ~ "zxcvbnm<>?"

# Let's define the scan codes of the main Russian keys
#
map -caps -shift 0x29 0x02..0x0D ~ "ё1234567890-="
map -caps -shift 0x10..0x1B 0x2B ~ "йцукенгшщзхъ\"
map -caps -shift 0x1E..0x28 ~ "фывапролджэ"
map -caps -shift 0x2C..0x35 ~ "ячсмитьбю."

map -caps +shift 0x29 0x02..0x0D ~ "Ё!"№;%:?*()_+"
map -caps +shift 0x10..0x1B 0x2B ~ "ЙЦУКЕНГШЩЗХЪ/"
map -caps +shift 0x1E..0x28 ~ "ФЫВАПРОЛДЖЭ"
map -caps +shift 0x2C..0x35 ~ "ЯЧСМИТЬБЮ,"

map +caps -shift 0x29 0x02..0x0D ~ "Ё1234567890-="
map +caps -shift 0x10..0x1B 0x2B ~ "ЙЦУКЕНГШЩЗХЪ\"
map +caps -shift 0x1E..0x28 ~ "ФЫВАПРОЛДЖЭ"
map +caps -shift 0x2C..0x35 ~ "ЯЧСМИТЬБЮ,"

map +caps +shift 0x29 0x02..0x0D ~ "ё!"№;%:?*()_+"
map +caps +shift 0x10..0x1B 0x2B ~ "йцукенгшщзхъ/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and other lines) duplicates the same scancodes and modifier combination as a previous line:

map +caps +shift 0x10..0x1B 0x2B ~ "qwertyuiop{}|"

There needs to be something that distinguishes the context of typing these characters for the mapping to work correctly. For example, if the user presses "q" or "й", this map will result in the same sequence of scancodes being sent, but that sequence will not necessarily be interpreted to produce "q" (or "й"). Proper behavior will depend on some sort of additional state that Guacamole isn't aware of, and the intent of the user may not match what ultimately ends up typed.

Is there something else that needs to be supported by these keymaps for this to be unambiguous? Does the Russian keyboard have additional modifier keys or state that needs to be represented?

map +caps +shift 0x1E..0x28 ~ "фывапролджэ"
map +caps +shift 0x2C..0x35 ~ "ячсмитьбю,"