Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'boundKeyPressCombos' (a nil value) #738

Open
2 of 5 tasks
ericcobblepot opened this issue Apr 8, 2024 · 8 comments
Open
2 of 5 tasks

'boundKeyPressCombos' (a nil value) #738

ericcobblepot opened this issue Apr 8, 2024 · 8 comments
Labels
Priority: Low Minor impact Stale Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@ericcobblepot
Copy link

Priority

Low

Area

  • Data
  • Source
  • Docker
  • Other

What happened?

I don't know how to reproduce, it only appears a couple of times, just by type on the keyboard

ERROR: Lua exception: /corelib/keyboard.lua:103: attempt to index field 'boundKeyPressCombos' (a nil value)
stack traceback:
    [C]: in function '__index'
    /corelib/keyboard.lua:103: in function </corelib/keyboard.lua:99>
ERROR: protected lua call failed: LUA ERROR:
/corelib/keyboard.lua:103: attempt to index field 'boundKeyPressCombos' (a nil value)
stack traceback:
    [C]: in function '__index'
    /corelib/keyboard.lua:103: in function </corelib/keyboard.lua:99>

What OS are you seeing the problem on?

Windows

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ericcobblepot ericcobblepot added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Apr 8, 2024
@github-actions github-actions bot added Priority: Low Minor impact Status: Pending Test This PR or Issue requires more testing labels Apr 8, 2024
@Nottinghster
Copy link
Collaborator

Nottinghster commented Apr 10, 2024

Try this:

local function onWidgetKeyPress(widget, keyCode, keyboardModifiers, autoRepeatTicks)
    if keyCode == KeyUnknown then
        return false
    end

    local boundKeyPressCombos = widget.boundKeyPressCombos or {}
    local callback = widget.boundKeyPressCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
    return signalcall(callback, widget, keyCode, autoRepeatTicks)
end

@luanluciano93
Copy link
Collaborator

@ericcobblepot Did you test with @Nottinghster suggestion?

@ericcobblepot
Copy link
Author

local boundKeyPressCombos = widget.boundKeyPressCombos or {}

or {}

this only prevents the error in console
It is a patch solution

@kojimhojo
Copy link

kojimhojo commented Jun 14, 2024

@ericcobblepot

I found a way to reproduce it

1: open console
> g_game.requestChannels()

2: press the key SCAPE

3: bug:

ERROR: Lua exception: /corelib/keyboard.lua:103: attempt to index field 'boundKeyPressCombos' (a nil value)
stack traceback:
    [C]: in function '__index'
    /corelib/keyboard.lua:103: in function </corelib/keyboard.lua:99>
ERROR: protected lua call failed: LUA ERROR:
/corelib/keyboard.lua:103: attempt to index field 'boundKeyPressCombos' (a nil value)
stack traceback:
    [C]: in function '__index'
    /corelib/keyboard.lua:103: in function </corelib/keyboard.lua:99>

@leoddias
Copy link
Contributor

leoddias commented Jul 25, 2024

@Nottinghster why do you closed it? The solution that you provided didn't worked.
This bug still happen on "main" branch.

Also I have issues with hotkeys in general, sometimes all hotkeys stop to work, I should logoff and login in order to have them working again... idk how to reproduce it yet.

@luanluciano93 luanluciano93 reopened this Jul 25, 2024
@leoddias
Copy link
Contributor

leoddias commented Aug 16, 2024

I found a way to reproduce the hotkeys bug:
Keep Pressing CTRL+G while clicking in Cancel Button, do it few times and any ComboKeys (F1~F12, etc) will work.

It happens sometimes while playing idk why.

@kokekanon
Copy link
Collaborator

kokekanon commented Aug 25, 2024

2024-08-25.15-28-34.mp4

apparently the error is related to this

image

https://github.com/mehah/otclient/blob/main/modules/corelib/ui/uiwindow.lua#L50-L62
on
f247211

Copy link

This issue is stale because it has been open 120 days with no activity.

@github-actions github-actions bot added the Stale label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Minor impact Stale Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

6 participants