• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM My Caps-Lock are HIDING!!!???

MIchael PS

Member
Hello...

I have a serious problem here. Is there a way to get input from CAPS-LOCK??
Or is there a way to set CAPS-LOCK ON through gamemaker???
Thats what I need!!!

(P.S.: Is there a way to set THE LANGUAGE THAT WE ARE TYPING IN ENGLISH through gamemaker???)

Thank you for your time!!!
 
Last edited:

Gamebot

Member
You can always use string_upper() function for the caps lock, assuming you want all capitol letters. Otherwise state your problem and what your trying to accomplish there may be another way. ;)

When you say typing in english, like a translator or GM itself in the code editor?
 

CloseRange

Member
@MIchael PS
I wanted to test it out to see what would happen and i think i figured it out:
just use the value 20
Code:
keyboard_check_pressed(20);
the way I got 20 was using this chart and looking at the key code for caps lock

As for checking if caps is on i'm not sure and I'm also not sure for directly setting caps lock to true (this might be against the sandbox rules of game maker)

when it comes to checking if you are typing in english I'm not sure what you mean. Do you mean if what the player types is english? I wouldn't see how that is possible because a lot of other languages use the same characters as english (the abc alphabet, excluding special characters like à )

Anyway hope this helps!!
 

MIchael PS

Member
You can always use string_upper() function for the caps lock, assuming you want all capitol letters. Otherwise state your problem and what your trying to accomplish there may be another way. ;)

When you say typing in english, like a translator or GM itself in the code editor?
@MIchael PS
I wanted to test it out to see what would happen and i think i figured it out:
just use the value 20
Code:
keyboard_check_pressed(20);
the way I got 20 was using this chart and looking at the key code for caps lock

As for checking if caps is on i'm not sure and I'm also not sure for directly setting caps lock to true (this might be against the sandbox rules of game maker)

when it comes to checking if you are typing in english I'm not sure what you mean. Do you mean if what the player types is english? I wouldn't see how that is possible because a lot of other languages use the same characters as english (the abc alphabet, excluding special characters like à )

Anyway hope this helps!!
Thanks!!!
Well, when I say typing in english, I mean for example:
I am from greece, and my keyboard has 2 custom languages, greek and english. When I start the game I want that to turn english on, so that when I ask for the name of the player, the name will be in english. Because if I write it in greek there will appear nothing at all, 'cause my font has not greek letters to show.
Is there any way to fix it???
Thenx again!!! ;-)
 

Dmi7ry

Member
You can't control it. But, for example, you can replace each char with code bigger than 127 (or so) to "?". So, user will see "???" chars and know that it's a wrong keyboard layout.
 

MIchael PS

Member
You can't control it. But, for example, you can replace each char with code bigger than 127 (or so) to "?". So, user will see "???" chars and know that it's a wrong keyboard layout.

Thank you for your help...
How can I change the string the player gives with a char bigger than 127, using code???
 

Dmi7ry

Member
Something like this:
Code:
var t = "";
for (var i=1; i<=string_length(keyboard_string); i++)
{
    var char = string_char_at(keyboard_string, i)
    if ord(char) > 127
        t += "?";
    else
        t += char;
}
keyboard_string = t;
 

MIchael PS

Member
Something like this:
Code:
var t = "";
for (var i=1; i<=string_length(keyboard_string); i++)
{
    var char = string_char_at(keyboard_string, i)
    if ord(char) > 127
        t += "?";
    else
        t += char;
}
keyboard_string = t;
That works amazingly!!!
Thanks!!!!
 
Top