From 25f1e3d861d03e891c72c27d0d616eb535997925 Mon Sep 17 00:00:00 2001 From: SerVB Date: Mon, 28 Sep 2020 18:56:26 +0300 Subject: [PATCH] PRJ-121 Add an option to disable automatic keymap setting --- .../org/jetbrains/projector/server/ProjectorServer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projector-server/src/main/kotlin/org/jetbrains/projector/server/ProjectorServer.kt b/projector-server/src/main/kotlin/org/jetbrains/projector/server/ProjectorServer.kt index c757af33..c0417c2d 100644 --- a/projector-server/src/main/kotlin/org/jetbrains/projector/server/ProjectorServer.kt +++ b/projector-server/src/main/kotlin/org/jetbrains/projector/server/ProjectorServer.kt @@ -375,7 +375,10 @@ class ProjectorServer private constructor( is ClientOpenLinkEvent -> markdownPanelUpdater.openInExternalBrowser(message.link) is ClientSetKeymapEvent -> if (isAgent) { - logger.info { "Client keymap was ignored!" } + logger.info { "Client keymap was ignored (agent mode)!" } + } + else if (getProperty(ENABLE_AUTO_KEYMAP_SETTING)?.toBoolean() == false) { + logger.info { "Client keymap was ignored (property specified)!" } } else { KeymapSetter.setKeymap(message.keymap) @@ -972,5 +975,7 @@ class ProjectorServer private constructor( var BIG_COLLECTIONS_CHECKS_START_SIZE = System.getProperty("org.jetbrains.projector.server.debug.collections.checks.size")?.toIntOrNull() ?: DEFAULT_BIG_COLLECTIONS_CHECKS_SIZE + + const val ENABLE_AUTO_KEYMAP_SETTING = "ORG_JETBRAINS_PROJECTOR_SERVER_AUTO_KEYMAP" } }