keygrabber: Fix the key sequence recording. (#2758)

The origial implementation was broken and nobody noticed until now.

Fix #2757
This commit is contained in:
Emmanuel Lepage Vallée 2019-04-24 20:15:39 -04:00 committed by GitHub
parent 755c44ca52
commit f03d5474cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,8 +224,8 @@ local function runner(self, modifiers, key, event)
local seq_len = glib.utf8_strlen(self.sequence, -1)
-- Record the key sequence
if key == "BackSpace" and seq_len > 0 then
self.sequence = glib.utf8_substring(self.sequence, 0, seq_len - 2)
if key == "BackSpace" and seq_len > 0 and event == "release" then
self.sequence = glib.utf8_substring(self.sequence, 0, seq_len - 1)
elseif glib.utf8_strlen(key, -1) == 1 and event == "release" then
self.sequence = self.sequence..key
end