Key Steal Manager
The key steal manager provides functionality in battle and frontend game modes related to stealing the ESC key and intercepting key presses.
In battle, the battle_manager automatically creates a key-steal manager and provides a pass-through interface to its functions via battle_manager:steal_escape_key_with_callback and battle_manager:release_escape_key_with_callback. Do not try to manually create and use a key-steal manager in battle, but instead use the battle manager's pass-through interface.
In the frontend, a key steal manager is automatically created when the libs are loaded. This is called ksm. In frontend, functions listed on this page can be called in the following form:
Example:
					ksm:<function_name>(<args>)
				| Loaded in Campaign | 
										 | 
								
| Loaded in Battle | 
										 | 
								
| Loaded in Frontend | 
										 | 
								
- 
							
key_steal_manager:new() - 
							Creates and returns a new key-steal manager. This should not be called by client scripts - in battle, the 
battle_managercreates a key steal manager internally, and in the frontend a key steal manager is created automatically by the script libraries.Returns:
key steal managerkey_steal_manager
defined in ../../Warhammer/working_data/script/_lib/lib_key_steal_manager.lua, line 32
 
- 
							
key_steal_manager:steal_escape_key_with_callback(callback name
string,callback
function,is persistent
[boolean]
) - 
							Steals the escape key if it wasn't stolen before, and registers a callback to be called if the player presses it. The callback entry must be registered with a unique string name, by which it may be cancelled later if desired.
Multiple escape key callbacks may be registered at one time, although only the most recently-registered callback is notified when the ESC key is pressed. Once an ESC key callback is called it is removed from the list, and the next ESC key press causes the next most recent callback to be notified, and so-on.Parameters:
1
Callback name.
2
Callback to call.
3
optional, default value=false
Key should remain stolen after callback is first called.
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_key_steal_manager.lua, line 125
 
- 
							
key_steal_manager:release_escape_key_with_callback(callback name to cancelstring) - 
							Cancels an escape key callback registered with 
key_steal_manager:steal_escape_key_with_callbackby name.Parameters:
1
callback name to cancel
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_key_steal_manager.lua, line 171