From 53c0a65a5bdaf19be6eeabeefe7d79c193d6c33c Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 31 Oct 2022 02:11:54 +0100 Subject: [PATCH] ExternalKeyboard: Don't spam the "Keyboard connected" InfoMessage Only show it for the first keyboard --- plugins/externalkeyboard.koplugin/main.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/externalkeyboard.koplugin/main.lua b/plugins/externalkeyboard.koplugin/main.lua index 842f4b458..7196f9fe3 100644 --- a/plugins/externalkeyboard.koplugin/main.lua +++ b/plugins/externalkeyboard.koplugin/main.lua @@ -329,10 +329,13 @@ function ExternalKeyboard:setupKeyboard(event_path) Device.hasKeyboard = yes Device.hasDPad = has_dpad_func - UIManager:show(InfoMessage:new{ - text = _("Keyboard connected"), - timeout = 1, - }) + -- Only show this once + if ExternalKeyboard.connected_keyboards == 1 then + UIManager:show(InfoMessage:new{ + text = _("Keyboard connected"), + timeout = 1, + }) + end InputText.initInputEvents() UIManager:broadcastEvent(Event:new("PhysicalKeyboardConnected")) end