use awful.keygrabber

This commit is contained in:
Xinhao Yuan 2019-07-24 18:11:44 -04:00
parent 9e6bb42623
commit 11c804266c
2 changed files with 4 additions and 6 deletions

View File

@ -8,7 +8,6 @@ local api = {
awful = require("awful"),
screen = require("awful.screen"),
layout = require("awful.layout"),
keygrabber = require("awful.keygrabber"),
naughty = require("naughty"),
gears = require("gears"),
gfs = require("gears.filesystem"),
@ -585,7 +584,7 @@ local function create(data)
init(screen.workarea)
refresh()
kg = keygrabber.run(
kg = api.awful.keygrabber.run(
function (mod, key, event)
if event == "release" then
return
@ -711,7 +710,7 @@ local function create(data)
end
if to_exit then
keygrabber.stop(kg)
api.awful.keygrabber.stop(kg)
end
end
)

View File

@ -5,7 +5,6 @@ local api = {
awful = require("awful"),
screen = require("awful.screen"),
layout = require("awful.layout"),
keygrabber = require("awful.keygrabber"),
naughty = require("naughty"),
gears = require("gears"),
lgi = require("lgi"),
@ -178,7 +177,7 @@ local function start(c)
infobox.bgimage = draw_info
local kg
kg = keygrabber.run(
kg = api.awful.keygrabber.run(
function (mod, key, event)
if event == "release" then return end
if key == "Tab" then
@ -275,7 +274,7 @@ local function start(c)
end
elseif key == "Escape" or key == "Return" then
infobox.visible = false
keygrabber.stop(kg)
api.awful.keygrabber.stop(kg)
else
print("Unhandled key " .. key)
end