From afbb3b7fafe2d87db1ca50d6738a7748407c15a1 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 19 Oct 2019 19:09:44 -0400 Subject: [PATCH] shims: Add the legacy _keys and _buttons to the client shims. --- tests/examples/shims/client.lua | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index cf209305..f2067131 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -75,7 +75,8 @@ function client.gen_fake(args) ret.name = "Example Client" ret._private._struts = { top = 0, right = 0, left = 0, bottom = 0 } - -- Deprecated. + --TODO v5: remove this. This was a private API and thus doesn't need to be + -- officially deprecated. ret.data = ret._private -- This is a hack because there's a `:is_transient_for(c2)` method @@ -246,6 +247,23 @@ function client.gen_fake(args) ret.above = false ret.sticky = false + -- Declare the deprecated buttons and keys methods. + function ret:_keys(new) + if new then + ret._private.keys = new + end + + return ret._private.keys or {} + end + + function ret:_buttons(new) + if new then + ret._private.buttons = new + end + + return ret._private.buttons or {} + end + -- Add to the client list table.insert(clients, ret)