Skip to content

Instantly share code, notes, and snippets.

@Colbss
Colbss / KeyMappings.ts
Last active May 15, 2025 02:29
Convert GTA V / FiveM keybind to JS eventCode / human readable string. Intended to be used with ox_lib keybind getCurrentKey().
// Key mapping interface
export interface KeyMapping {
key: string; // Human-readable key name
keyButton: string; // Value sent from Lua
eventCode?: string | null; // JavaScript event listener code
displayName?: string; // Display name for UI
}
// Complete mapping of all keys
export const keyMappings: KeyMapping[] = [