I'm having an Issue with UTF-8
When I have a key lets use "F1" as an example.
It's keycode is "112" However using
I'm saving these key codes to an ini then loading those codes to there correct key to be used and customized by the player, but I want to include special keys like F1-12, Shift, Ctrl, alt, ect..
Is there something I'm doing wrong? Any help is appreciated as all ways, Thanks.
When I have a key lets use "F1" as an example.
It's keycode is "112" However using
chr(112)
I get "p" because "p"'s code is "11"I'm saving these key codes to an ini then loading those codes to there correct key to be used and customized by the player, but I want to include special keys like F1-12, Shift, Ctrl, alt, ect..
Is there something I'm doing wrong? Any help is appreciated as all ways, Thanks.
GML:
//DEFAULT GLOBAL SETTINGS
global.Player_Key_Move_Up = 122; //this is a test for F1, trying to do ord("F1") gets the code for "F"
global.Player_Key_Move_Down = ord("S");
global.Player_Key_Move_Left = ord("A");
global.Player_Key_Move_Right = ord("D");
//LOAD SETTINGS
if (file_exists(working_directory + "config.ini"))
{
//open it
ini_open(working_directory + "config.ini")
//read variables
global.Player_Key_Move_Up = ini_read_real("KeyBinds", "Movement_Up" ,global.Player_Key_Move_Up);
global.Player_Key_Move_Down = ini_read_real("KeyBinds", "Movement_Down" ,global.Player_Key_Move_Down);
global.Player_Key_Move_Left = ini_read_real("KeyBinds", "Movement_Left" ,global.Player_Key_Move_Left);
global.Player_Key_Move_Right = ini_read_real("KeyBinds", "Movement_Right" ,global.Player_Key_Move_Right);
//done
ini_close();
}
else //SAVE SETTINGS
{
//open it
ini_open(working_directory + "config.ini")
//Save variables
ini_write_real("KeyBinds", "Movement_Up" ,global.Player_Key_Move_Up);
ini_write_real("KeyBinds", "Movement_Down" ,global.Player_Key_Move_Down);
ini_write_real("KeyBinds", "Movement_Left" ,global.Player_Key_Move_Left);
ini_write_real("KeyBinds", "Movement_Right" ,global.Player_Key_Move_Right);
//done
ini_close();
}
//MACROS- THESE ARE USED AS keyboard_check_pressed(PLAYERKEY_MOVE_UP) Becuase I dont want to type global. everytime Im lazy give me a break
#macro PLAYERKEY_MOVE_UP global.Player_Key_Move_Up
#macro PLAYERKEY_MOVE_DOWN global.Player_Key_Move_Down
#macro PLAYERKEY_MOVE_LEFT global.Player_Key_Move_Left
#macro PLAYERKEY_MOVE_RIGHT global.Player_Key_Move_Right