• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Accept Input for ".';/,[]\=-` Tab CapsLock Shift" & More?

B

Bladevampirek

Guest

I'm making a virtual keyboard, this will be used to make learning Touch Typing Easier for people, Game Maker cannot recognize the keys that I underlined with red in the photo above.
Is there a way to make it recognize any of these key inputs, so that I can change sprites when the key is pressed. All of the rest works just find using the drag and drop press key down, and release key function in order to replace them all with different sprites.
The Period in the drag and drop command list will work, but only for the NumPad, I need it to work in the same location as it's being displayed on the on-screen keyboard.
Is there a work around using Game Maker Language? If so I'd love to know about it.
Also, this isn't a big deal, but the Alt, Shift, Ctrl buttons highlight both instead of letting me choose left or right by default?
Any of you Wiz's can figure this out?
 
B

Bladevampirek

Guest
@YellowAfterlife
So
Code:
VK_LSHIFT
0xA0
Left SHIFT key
I do not understand the concept of how to use this? According to the site that was linked is for the Left Shift Key, can you please show me a quick example of the codes necessary to make an object change it's own sprite to a sprite called sprite0 using this command?
For Example, what I need in order to properly learn how to do this is,
Code:
"In Object 1 put this code in (step event) *Display Code*
and this other code *displays code* code in another event, if it's multiple events included.
So on and so forth, for 1 key so I can see a thorough example of how this works?
 

chamaeleon

Member
@YellowAfterlife
So
Code:
VK_LSHIFT
0xA0
Left SHIFT key
I do not understand the concept of how to use this? According to the site that was linked is for the Left Shift Key, can you please show me a quick example of the codes necessary to make an object change it's own sprite to a sprite called sprite0 using this command?
For Example, what I need in order to properly learn how to do this is,
Code:
"In Object 1 put this code in (step event) *Display Code*
and this other code *displays code* code in another event, if it's multiple events included.
So on and so forth, for 1 key so I can see a thorough example of how this works?
You may have to add a code block, as I don't think keyboard_check_direct() has a DnD equivalent.
Code:
if (keyboard_check_direct(vk_lshift))
  lshift_status = "DOWN"; // or set a sprite in your case
else
  lshift_status = "UP"; // or set a sprite in your case
 
B

Bladevampirek

Guest
@chamae
Code:
if keyboard_check_direct(vk_lshift)
   {
   sprite_index = slshift1
   }
else
{
sprite_index = slshift
}
This Worked for me, however the Windows key through back an error? Do I have to set the vkrwin key first? and if so, how can I do that? I just put this in the Step Event? Thanks for helping, I can already see this type of thing is exactly what my project needs.
Code:
if keyboard_check_direct(vk_rwin)
   {
   sprite_index = srwinkey1
   }
else
{
sprite_index = srwinkey
}
 

chamaeleon

Member
This Worked for me, however the Windows key through back an error? Do I have to set the vkrwin key first? and if so, how can I do that? I just put this in the Step Event? Thanks for helping, I can already see this type of thing is exactly what my project needs.
I guess there's no GMS vk_ key code for the Windows key, but you can try
Code:
if (keyboard_check_direct(0x5b))
    sprite_index = srwinkey1;
else
    sprite_index = srwinkey;
 
B

Bladevampirek

Guest
I guess there's no GMS vk_ key code for the Windows key, but you can try
Code:
if (keyboard_check_direct(0x5b))
    sprite_index = srwinkey1;
else
    sprite_index = srwinkey;
No such luck there either.
Code:
___________________________________________
FATAL ERROR in
action number 1
of  Step Event
for object orwinkey:

COMPILATION ERROR in code action
Error in code at line 1:
   if (keyboard_check_direct(0x5b))

at position 28: Symbol , or ) expected.
Thanks for all of the help you guys did do for me however. I think I might be able to resolve my problem with a third party program called, "Autohotkey" using a .ahk script by telling it to "ControlSend" Windows & other Keys I need to Gm Studio as a keystroke that Gm Studio can read for example, "F1" key to Gm Studio when the RWindowsKey is pressed, and let the game be programmed if "F1" is pressed then the Right Window Key will light up so that I can trick it into working.
Either that, or I'll just end up leaving out the Windows Key Entirely. If I do add it using that method, I'll have to have an additional script running beside of my game tho, I do not like that, but it will probably work. Thank You guys for all of the technical support you did for me. This worked for most of the keys, so now I don't have to do any type of work-arounds for most of the keys.
So just to be clear there's no way that you know of to program Game Maker to send any of the following keys, right?
Code:
Windows Key, Caps Lock, or the following puncutations done by the windows keybaord?

(,./<>?:"{[=-)(*&^%$#@!~`)
 

chamaeleon

Member
No such luck there either.
Code:
___________________________________________
FATAL ERROR in
action number 1
of  Step Event
for object orwinkey:

COMPILATION ERROR in code action
Error in code at line 1:
   if (keyboard_check_direct(0x5b))

at position 28: Symbol , or ) expected.
Thanks for all of the help you guys did do for me however. I think I might be able to resolve my problem with a third party program called, "Autohotkey" using a .ahk script by telling it to "ControlSend" Windows & other Keys I need to Gm Studio as a keystroke that Gm Studio can read for example, "F1" key to Gm Studio when the RWindowsKey is pressed, and let the game be programmed if "F1" is pressed then the Right Window Key will light up so that I can trick it into working.
Either that, or I'll just end up leaving out the Windows Key Entirely. If I do add it using that method, I'll have to have an additional script running beside of my game tho, I do not like that, but it will probably work. Thank You guys for all of the technical support you did for me. This worked for most of the keys, so now I don't have to do any type of work-arounds for most of the keys.
So just to be clear there's no way that you know of to program Game Maker to send any of the following keys, right?
Code:
Windows Key, Caps Lock, or the following puncutations done by the windows keybaord?

(,./<>?:"{[=-)(*&^%$#@!~`)
Try the following (although I didn't have to use $ instead of 0x.. Got the same result)
Code:
if (keyboard_check_direct($5b))
    sprite_index = srwinkey1;
else
    sprite_index = srwinkey;
 
B

Bladevampirek

Guest
@chamaeleon Yep, this time no error, but it didn't work either, game just lost focus whenever I tapped the windows key so it basically did nothing.
 
Top