def registerHotkey(self, shortcut, py_function_pointer):
""
"
Can be used by IDAscope widgets to register hotkeys.
Uses a global list HOTKEYS of
function
pointers that link to the desired functionality.
Right now, linked functions cannot take parameters and should scrape all information they need by themselves.
@param shortcut: A string describing a shortcut, e.g.
"ctrl+F3"
@
type
shortcut: str
@param py_function_pointer: a python
function
that shall be called when the shortcut is triggered.
@
type
py_function_pointer: a pointer to a python
function
""
"
global HOTKEYS
hotkey_index = len(HOTKEYS)
hotkey_name =
"idascope_HOTKEY_%d"
% hotkey_index
HOTKEYS.append(py_function_pointer)
self.ida_proxy.CompileLine(
'static %s() { RunPythonStatement("HOTKEYS[%d]()"); }'
% (hotkey_name, hotkey_index))
self.ida_proxy.AddHotkey(shortcut, hotkey_name)