Go to Page... |
|
Thread Tools | Display Modes |
|
03/30/15, 04:50 PM | #1 |
PreHooking Dialog's OnKeyUp -> Primary + Abort keybinding do not work anymore
Hey there,
I just tested somethign with a dialog and if I PreHook the OnKeyUp handler for the dialog + set dialog:SetKeyboardEnabled(true) (which is needed so the OnkeyUp method will be recognized at all) the standard keybindings of this dialog won#t work anymore :-( Any idea to achieve both: 1. Get listener on handler OnKeyUp and execute my own function 2. Get standrd keybindings to work for the accept and abort buttons of this dialog My idea was: -Get the keycodes for the primary and abort dialog keys (any function to read this from the settings to get the keycodes in the desired keycode style, e.g. KEY_E for the "e" button?) -Implement the OnKeyUp function to react on these two keycodes (accept and abort) as well Only problem is: If I tried to just execute the "callback" function of the accpet button by my source code I'll get an error because of another addon (Stacked). This is because Stacked already copied the original handler of this dialog's accept button and has implemented an own one. I can't see why the error is thrown but it does Here is my source code so far: Lua Code:
Last edited by Baertram : 04/02/15 at 11:41 AM. |
|
03/30/15, 09:12 PM | #2 |
|
Can you register the callback elsewhere or can only one control capture keybinds?
If they all register, use the OnKeyUp event for a different control (either one in scene or add your own to the scene). |
03/30/15, 10:36 PM | #3 |
|
There may be a way to avoid the problem entirely, but this would be a simple fix.
Just handle those keys that aren't working yourself: Lua Code:
Last edited by circonian : 03/30/15 at 10:39 PM. |
03/31/15, 01:47 AM | #4 |
@Circonian Thx. I tried this already (as I've written above) but not everyone is using KEY_E and KEY_ALT as the keybindings for accept or cancel.
Am I able to get the assigned keybindings somehow to react ont eh correct keys? Maybe someone changed it to KEY_G and KEY_CTRL. And as I said too the addon "stacked" raises an error if I try to call the callback function of the accept button. I'm not sure WHY it does this. It seems to copy the original callback to a backup function, exchange the callback function then with an own one, call the original function and then it's code to refresh some keybindings (so it's a Post-hook). Maybe I can pre-Hook the callback function of the accept button to avoid the error. @Sasky Good idea, I'll see if I can register the keybindings to the scene and then check if the dialog is shown. But I hope it won't disable keybinds of the keybind strip for all teh scene elements this way ^^ |
|
03/31/15, 07:24 AM | #5 | |
|
However, I think it'd be better if you got it to work without replacing existing bindings. |
|
03/31/15, 08:31 AM | #6 |
Thx merlight.
I'd love to get this to work but I don't know how? Everytime I enable the SetKeyboardEnabled(true) function the keybindings seem to get disabled :-( And without this keyboard enabled function I'm not able to react on the keys :-( Maybe I can get it to work by using the scene somehow. |
|
ESOUI » Developer Discussions » Lua/XML Help » PreHooking Dialog's OnKeyUp -> Primary + Abort keybinding do not work anymore |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|