View Single Post
08/15/14, 08:15 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Originally Posted by sirinsidiator View Post
Haven't tested this myself, but you could try something like this:

init:
Code:
local keybindButtonDescriptor = KEYBIND_STRIP.keybinds["UI_SHORTCUT_PRIMARY"]
local oldEnabled = keybindButtonDescriptor.enabled
disable:
Code:
keybindButtonDescriptor.enabled = false -- can also be a function that returns a boolean
KEYBIND_STRIP:UpdateKeybindButton(keybindButtonDescriptor)
enable:
Code:
keybindButtonDescriptor.enabled = oldEnabled
KEYBIND_STRIP:UpdateKeybindButton(keybindButtonDescriptor)
if this does not work, you could also replace keybindButtonDescriptor.callback with an empty function
I've tested it but it will only remove the text next to the keybind button and deactivate the onclick method (which leads to an error if you press the button).
So you'll see the buttons on the keybind strip at the bottom, for example [E] and [R]. But No text next to it anymore.
If you click them or press the key on your keayboard a lua error occurs:

Code:
EsoUI/Libraries/ZO_KeybindStrip/ZO_KeybindStrip.lua:20: attempt to index a boolean value
stack traceback:
	EsoUI/Libraries/ZO_KeybindStrip/ZO_KeybindStrip.lua:20: in function 'OnButtonClicked'
	EsoUI/Libraries/ZO_KeybindStrip/ZO_KeybindStrip.lua:234: in function 'ZO_KeybindStrip:TryHandlingKeybindDown'
	(tail call): ?
	(tail call): ?
But it's a good attempt. Maybe one can remove the controls from the keybind strip bar at the bottom (or make them invisible) and overwrite the onclick handler somehowe to let it do nothing.

I'll try to play around with
ZO_KeybindStrip_HandleKeybindDown
ZO_KeybindStrip_HandleKeybindUp

Last edited by Baertram : 08/15/14 at 08:35 AM.
  Reply With Quote