https://github.com/notexe/h3-simple-key-event-helper
Simple Key Event Helper (SKEH) is a Hitman 3 mod for mod developers who wish to add custom key bindings into their own mod.
https://github.com/notexe/h3-simple-key-event-helper
actionscript glacier hitman scaleform
Last synced: 3 months ago
JSON representation
Simple Key Event Helper (SKEH) is a Hitman 3 mod for mod developers who wish to add custom key bindings into their own mod.
- Host: GitHub
- URL: https://github.com/notexe/h3-simple-key-event-helper
- Owner: Notexe
- License: lgpl-3.0
- Created: 2024-03-12T05:48:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-06T13:13:24.000Z (12 months ago)
- Last Synced: 2025-02-07T20:19:07.278Z (5 months ago)
- Topics: actionscript, glacier, hitman, scaleform
- Language: ActionScript
- Homepage: https://www.nexusmods.com/hitman3/mods/744
- Size: 162 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Simple Key Event Helper
Adds a helper entitytemplate for developers who wish to add custom key bindings into their mod.
[Install](https://hitman-resources.netlify.app/smf-install-link/https://github.com/Notexe/h3-simple-key-event-helper/releases/latest/download/mod.framework.zip) | [Download](https://github.com/Notexe/h3-simple-key-event-helper/releases/latest/download/mod.framework.zip)
---
## Known issues
- Toggling the `m_bEnabled` property results in the keybinds not being set correctly if you are using the dynamic object method. I suspect the game for some reason falls back to the `m_sModifierKeyName` and `m_sKeyName` properties.
- Workaround: Use the Enable/Disable pins instead or send the `NotifyDataChanged` input pin to the dynamic object entity for the keybinds to get restored.## Usage
This helper mod allows you to setup custom keybinds which you can then use to fire pins in your mod. Please reference this mod in the "requirements" section in your mod's manifest like so:
```json
"requirements": [
"Notex.SimpleKeyEventHelper"
]
```There are two methods of using this mod:
1. First method: With this method you can just use the `m_sModifierKeyName` and `m_sKeyName` properties in the `SimpleKeyEventHelper` entity to configure the keybind.
2. Second method: This method involves using a dynamic object entity referenced in a property called `m_pDataProvider` in the `SimpleKeyEventHelper` entity. The second method can be used if you wish to provide customisability options in your SMF mod without having to use duplicated entity.json or entity.patch.json files.### First method
SimpleKeyEventHelper entity:
```json
{
"parent": null,
"name": "SimpleKeyEventHelper",
"factory": "[assembly:/Templates/UI/Controls/simplekeyeventhelper.template?/SimpleKeyEventHelper.entitytemplate].pc_entitytype",
"blueprint": "[assembly:/Templates/UI/Controls/simplekeyeventhelper.template?/SimpleKeyEventHelper.entitytemplate].pc_entityblueprint",
"properties": {
"m_sModifierKeyName": {
"type": "ZString",
"value": "None"
},
"m_sKeyName": {
"type": "ZString",
"value": "F7"
}
},
"events": {
"Pressed": {},
"Down": {},
"Up": {}
}
}
```### Second method
SimpleKeyEventHelper entity:
```json
{
"parent": null,
"name": "SimpleKeyEventHelper",
"factory": "[assembly:/Templates/UI/Controls/simplekeyeventhelper.template?/SimpleKeyEventHelper.entitytemplate].pc_entitytype",
"blueprint": "[assembly:/Templates/UI/Controls/simplekeyeventhelper.template?/SimpleKeyEventHelper.entitytemplate].pc_entityblueprint",
"properties": {
"m_pDataProvider": {
"type": "SEntityTemplateReference",
"value": "cafe4e160a2ca171"
}
},
"events": {
"Pressed": {},
"Down": {},
"Up": {}
}
}
```Dynamic Object entity:
```json
{
"parent": "cafe22132fb215d4",
"name": "DynamicObject",
"factory": "[modules:/zdynamicobjectentity.class].pc_entitytype",
"blueprint": "[modules:/zdynamicobjectentity.class].pc_entityblueprint",
"properties": {
"m_pJSONResource": {
"type": "ZRuntimeResourceID",
"value": "[assembly:/your/path/here.json].pc_json"
}
}
}
```JSON file:
```json
{
"modifier": "None", // Possible options are: None, Alt and Control
"key": "F2" // Possible values can be found here (ones with uint not string. "Example: F2 : uint = 113"): https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html
}
```### Properties and pins
#### Properties
- `m_bEnabled`: bool (defaults to true)
- `m_sModifierKeyName`: ZString (defaults to "None")
- `m_sKeyName`: ZString (defaults to "")
- `m_pDataProvider`: SEntityTemplateReference (defaults to null)See JSON example above for possible m_sModifierKeyName and m_sKeyName values
#### Input pins
- `Enable`: void (Enables keybinds)
- `Disable`: void (Disables keybinds)#### Output pins
- `Pressed`: void (Fires on key pressed down and repeats if held for over a second)
- `Down`: void (Fires on key pressed down)
- `Up`: void (Fires on key released)