Added Window#input_hijack to allow objects to get exclusive access to button_down/up callbacks, improved Chat widget

This commit is contained in:
2021-06-03 15:14:06 +00:00
parent ec2b32ff92
commit 0fe1d85924
6 changed files with 107 additions and 16 deletions

View File

@@ -53,6 +53,12 @@ class IMICFPS
end
end
def input_hijack=(hijacker)
@input_hijacker = hijacker
InputMapper.reset_keys
end
def needs_cursor?
false
end
@@ -92,6 +98,8 @@ class IMICFPS
def button_down(id)
if @show_console
@console.button_down(id)
elsif @input_hijacker
@input_hijacker.button_down(id)
else
super
end
@@ -105,6 +113,8 @@ class IMICFPS
def button_up(id)
if @show_console
@console.button_up(id)
elsif @input_hijacker
@input_hijacker.button_up(id)
else
super
end