From c36ec1e6c303e8fcbe1b7930cba6feb883757ff0 Mon Sep 17 00:00:00 2001 From: Bryan Kaplan Date: Thu, 31 Mar 2016 16:24:59 -0700 Subject: [PATCH] Fix backspace capture Backspace characters were not previously recognized, at least not on my system running Arch Linux. Some systems may send a Delete character (ASCII 127) when the user presses the Backspace key, but this behavior is incorrect, or at least non-standard. The Backspace key should type a Backspace character (ASCII 8). With this commit we retain the previous support for Delete characters, while adding identical support for actual Backspace characters. --- keepkeylib/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepkeylib/client.py b/keepkeylib/client.py index 5de5f896..2b6a71b7 100644 --- a/keepkeylib/client.py +++ b/keepkeylib/client.py @@ -272,7 +272,7 @@ def callback_CharacterRequest(self, msg): # capture spaces return proto.CharacterAck(character=' ') - elif character_ascii == 127 \ + elif character_ascii == 8 or character_ascii == 127 \ and (msg.word_pos > 0 or msg.character_pos > 0): # capture backspaces return proto.CharacterAck(delete=True)