Allows easy saving and loading of InputMap in Godot 4.2.1
Download latest version from releases or clone the repository. Move files to your main project folder.
Make sure that translations.csv
imported correctly.
Go to Project → Project Settings → Localization and add all generated .translation
files.
Supported languages |
---|
English |
Polish |
Type | GDScript code | Default value | Additional informations |
---|---|---|---|
Save path | set_path(<path>") |
user://input_map.tres |
|
Ignore ui_ | set_ignore_ui(<bool>) |
false |
|
Ignore editor_ | set_ignore_ui(<bool>) |
true |
|
Limit of assigned keys/buttons/axes | set_limit(<int>) |
0 |
less than or equal to 0 = unlimited |
Type | GDScript code |
---|---|
Save path | ```get_path |
Ignore ui_ | get_ignore_ui() |
Ignore editor_ | get_ignore_ui() |
Limit | get_limit() |
Type | GDScript code |
---|---|
Save | input_map_save() |
Load | input_map_load() |
Type | GDScript code | Device | Type | Array | Physical |
---|---|---|---|---|---|
Save path | get_input_action_mapped_keys(<action>,<device>,<type>,<array>) |
true |
true |
true |
true |
Name | Description |
---|---|
<device> |
Display the controller number. |
<type> |
Display the input type. |
<array> |
Function should return an array instead of string. |
<physical> |
Display information if the key is physical. |
Type | GDScript code |
---|---|
Index | get_input_action_event_at(<action>,<index>) |
First | get_input_action_first_event(<action>) |
Last | get_input_action_last_event(<action>) |
Type | GDScript code |
---|---|
Is duplicated | is_duplicated(<action_a>,<action_b>) |
Type | GDScript code | Keyboard | Mouse | Gamepad |
---|---|---|---|---|
Is valid | is_valid_input_event(<event>,<keyboard>,<mouse>,<gamepad>) |
true |
true |
true |
Type | GDScript code |
---|---|
Add | add_to_input_action_mapped(<action>,<event>) |
Remove | remove_from_input_action_mapped(<action>,<event>) |
Replace | replace_one_in_input_action_mapped(<action>,<event>) |
Type | GDScript code | Weak | Strong | Duration |
---|---|---|---|---|
Is valid | vibrate_all_joypads(<weak>,<strong>,<duration>) |
float |
float |
0 |
func _ready():
var gims = Gims.new()
gims.input_map_save()
pass
func _ready():
func _ready():
var gims = Gims.new()
gims.set_path("user://my_input_custom_name.tres")
gims.set_ignore_ui(true)
gims.set_ignore_editor(true)
gims.input_map_save()
pass
func _ready():
var gims = Gims.new()
gims.input_map_load()
pass
func _ready():
func _ready():
var gims = Gims.new()
gims.set_path("user://my_input_custom_name.tres")
gims.input_map_load()
pass
func _ready():
var gims = Gims.new()
print(gims.get_input_action_mapped("ui_right"))
pass
func _ready():
var gims = Gims.new()
print(gims.is_duplicated("ui_right","ui_left"))
pass
extends Node2D
var gims = Gims.new()
func _ready():
pass
func _input(event):
if gims.is_valid_input_event(event):
print("Keyboard/Mouse/Joypad")
extends Node2D
var gims = Gims.new()
func _ready():
pass
func _input(event):
if gims.is_valid_input_event(event,true,false,false):
print("Only keyboard")
extends Node2D
var gims = Gims.new()
func _ready():
pass
func _input(event):
if gims.is_valid_input_event(event,true,false,true):
print("Only keyboard and joypad")
extends Node2D
var gims = Gims.new()
func _ready():
print(gims.get_input_action_mapped("ui_right"))
pass
func _input(event):
if gims.is_valid_input_event(event):
gims.add_to_input_action_mapped("ui_right",event)
print(gims.get_input_action_mapped("ui_right"))
print("Added")
extends Node2D
var gims = Gims.new()
func _ready():
print(gims.get_input_action_mapped("ui_right"))
pass
func _input(event):
if gims.is_valid_input_event(event):
gims.remove_from_input_action_mapped("ui_right",event)
print(gims.get_input_action_mapped("ui_right"))
print("Removed")
extends Node2D
var gims = Gims.new()
func _ready():
gims.vibrate_all_joypads(0.25, 0.25, 0.1)
pass