X Tutup
Skip to content

PANEL:OnKeyCodePressed not called for ESC (Menu) and PANEL:OnKeyCodeReleased not called for TILDE (Console) #2886

@mandrewpowers

Description

@mandrewpowers

Details

Edit: Just to clear it up, the opposite hooks are called for these keys.

Working on a tool that uses a DLL to run gameui_preventescapetoshow and gameui_allowescapetoshow. The DLL isn't important here, but it made me realize that ESCAPE and TILDE do not seem to trigger PANEL:OnKeyCodePressed and PANEL:OnKeyCodeReleased properly. I am detecting these to handle the input depending on if the DLL is enabled. When writing in the support for that I realized ESCAPE was not closing my frame. Then I realized that PANEL:OnKeyCodePressed was not being called for that key.

If this was by design I think it should either check the status of gameui_preventescapetoshow or not change it's behavior at all.

Steps to reproduce

Run this to get a focused frame and press some buttons:

lua_run_cl TEST = vgui.Create('DFrame') TEST:MakePopup() TEST.OnKeyCodePressed = function(_, k) print('Pressed '..k) end TEST.OnKeyCodeReleased = function(_, k) print('Released '..k) end TEST:RequestFocus()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can't/Won't fixThe issue cannot or will not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup