From 2f1c5ef04de0eb702cbd66360c17b51cdfd09d96 Mon Sep 17 00:00:00 2001 From: EmeraldBlock <69981203+EmeraldBlock@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:05:13 -0500 Subject: [PATCH] Fix getStringForKeyCode returning wrong result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the full stop/period (.) key to the switch statement, and replaces String.fromCharCode (which works with Unicode) with the replacement character (�). --- src/js/game/key_action_mapper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/game/key_action_mapper.js b/src/js/game/key_action_mapper.js index 9c1b2f96..5d56a8f9 100644 --- a/src/js/game/key_action_mapper.js +++ b/src/js/game/key_action_mapper.js @@ -248,6 +248,8 @@ export function getStringForKeyCode(code) { return ","; case 189: return "-"; + case 190: + return "."; case 191: return "/"; case 219: @@ -260,7 +262,7 @@ export function getStringForKeyCode(code) { return "'"; } - return String.fromCharCode(code); + return "�"; } export class Keybinding {