Skip to content

Commit

Permalink
chore(client)!: Rename onKeyBoardEvent to onKeyboardEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
xLuxy committed Jan 17, 2024
1 parent 27641f3 commit 8c6ea99
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/js/compatibility/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class Utils extends SharedUtils {

cppBindings.registerCompatibilityExport("Utils", Utils);

alt.Events.onKeyBoardEvent(({ key, state }) => {
alt.Events.onKeyboardEvent(({ key, state }) => {
if (!Keybind.registeredHandlers.has(key)) return;

const boundKeys = Keybind.registeredHandlers.get(key);
Expand Down
4 changes: 2 additions & 2 deletions client/js/events/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { Event } = requireBinding("shared/events.js");

Event.register(alt.Enums.EventType.CONNECTION_COMPLETE, "ConnectionComplete");
Event.register(alt.Enums.EventType.DISCONNECT_EVENT, "Disconnect");
Event.register(alt.Enums.EventType.KEYBOARD_EVENT, "KeyBoardEvent");
Event.register(alt.Enums.EventType.KEYBOARD_EVENT, "KeyboardEvent");
Event.register(alt.Enums.EventType.WEB_VIEW_EVENT, "WebViewEvent");
Event.register(alt.Enums.EventType.WEB_SOCKET_CLIENT_EVENT, "WebSocketEvent");
Event.register(alt.Enums.EventType.AUDIO_EVENT, "AudioEvent");
Expand All @@ -15,7 +15,7 @@ Event.register(alt.Enums.EventType.WINDOW_RESOLUTION_CHANGE, "WindowResolutionCh
Event.register(alt.Enums.CustomEventType.KEY_UP, "KeyUp", true);
Event.register(alt.Enums.CustomEventType.KEY_DOWN, "KeyDown", true);

alt.Events.onKeyBoardEvent(({ state, key }) => {
alt.Events.onKeyboardEvent(({ state, key }) => {
if (state === alt.Enums.KeyState.UP) Event.invoke(alt.Enums.CustomEventType.KEY_UP, { key: key }, true);
else if (state === alt.Enums.KeyState.DOWN) Event.invoke(alt.Enums.CustomEventType.KEY_DOWN, { key: key }, true);
});
6 changes: 3 additions & 3 deletions types/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,8 @@ declare module "@altv/client" {
export function onScriptRPCAnswer(callback: GenericEventCallback<ScriptRPCAnswerEventParameters>): altShared.Events.EventHandler;
export function onceScriptRPCAnswer(callback: GenericEventCallback<ScriptRPCAnswerEventParameters>): altShared.Events.EventHandler;

export function onKeyBoardEvent(callback: GenericEventCallback<KeyBoardEventParameters>): altShared.Events.EventHandler;
export function onceKeyBoardEvent(callback: GenericEventCallback<KeyBoardEventParameters>): altShared.Events.EventHandler;
export function onKeyboardEvent(callback: GenericEventCallback<KeyboardEventParameters>): altShared.Events.EventHandler;
export function onceKeyboardEvent(callback: GenericEventCallback<KeyboardEventParameters>): altShared.Events.EventHandler;
export function onKeyUp(callback: GenericEventCallback<KeyUpDownEventParameters>): altShared.Events.EventHandler;
export function onceKeyUp(callback: GenericEventCallback<KeyUpDownEventParameters>): altShared.Events.EventHandler;
export function onKeyDown(callback: GenericEventCallback<KeyUpDownEventParameters>): altShared.Events.EventHandler;
Expand Down Expand Up @@ -1660,7 +1660,7 @@ declare module "@altv/client" {
key: altShared.Enums.KeyCode;
}

interface KeyBoardEventParameters {
interface KeyboardEventParameters {
key: altShared.Enums.KeyCode;
state: altShared.Enums.KeyState;
}
Expand Down
2 changes: 1 addition & 1 deletion types/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@altv/client",
"version": "0.0.23",
"version": "0.0.24",
"description": "This package contains the type definitions for the alt:V JS module v2 client types",
"types": "index.d.ts",
"files": [
Expand Down

0 comments on commit 8c6ea99

Please sign in to comment.