This commit is contained in:
2019-10-31 22:47:36 +03:00
parent cddc5fa70f
commit a91351d3dc
6 changed files with 31 additions and 61 deletions

View File

@ -116,12 +116,19 @@ func setupLayers(mainwindow *mainwindow.MainWindow) {
func decodeInput(ctx util.ClientCtx, baseLayer *mainwindow.Layer) {
var exit = false
var waitForWCspam = true
for !exit{
select {
case keycode := <-State.rawInput:
if keycode == blt.TK_NONE {
continue
}
if keycode == blt.TK_CLOSE && !waitForWCspam {
ctx.Logger().Warn().Msg("exiting on window close...")
State.exit <- struct{}{}
ctx.Logger().Warn().Msg("...done")
return
}
var pressed= ""
var isModifier, _= util.InArray(keycode, modifiers)
if !isModifier {
@ -153,6 +160,7 @@ func decodeInput(ctx util.ClientCtx, baseLayer *mainwindow.Layer) {
exit = true
return
default:
waitForWCspam = false;
State.input <- pressed
}
}