GameMaker: Studio has a number of constants and functions related to the keyboard and how it can be used to make things happen in your games.
When dealing with the keyboard in GameMaker: Studio you have a variety of functions that can be used to recognise different keyboard states like pressed or released. There are also some that store all the keypresses as a string or that can tell you what the last key pressed was, as well as others that allow you to clear the keyboard state completely.
NOTE: These functions are designed for Windows/Mac/Ubuntu desktop platforms only. You may find some of the in-built variables and constants aren't valid on other platforms and many of the functions won't work on mobiles.
Now, each key is normally defined by a number, called the ascii code, and you can directly input this number into these functions and they will work fine... But, as it's a bit difficult to remember so many numbers and the relationship that they have with your keyboard, GameMaker: Studio has a series of constants for the most used keyboard special keys and a special function ord() to return the number from ordinary typed characters (either letters or numbers).
The following is a small example of how to use ord():
Windows supports a mouse having up to three buttons. On a three-button mouse, the buttons are designated as the left, middle, and right buttons. Messages and named constants related to the mouse buttons use the letters L, M, and R to identify the buttons. The button on a single-button mouse is considered to be the left button.
hspeed = -5;
So, the above will check the 'A' key and if it's being pressed then it'll set the horizontal speed of the object to -5. Note, that the 'A' is a capital 'A', and that when using ord() the keyboard key to check must always be written in quotes and as a capital. Now, what if you want to use the arrow keys? Or if you want to modify an action using the 'shift' key? Well, for that GameMaker: Studio has a series of vk_ constants (vk_ stands for virtual keyboard) that you can use in place of ord or the ascii code.
Here is a complete list of the vk_ constants:
|vk_nokey||keycode representing that no key is pressed|
|vk_anykey||keycode representing that any key is pressed|
|vk_left||keycode for left arrow key|
|vk_right||keycode for right arrow key|
|vk_up||keycode for up arrow key|
|vk_down||keycode for down arrow key|
|vk_shift||either of the shift keys|
|vk_control||either of the control keys|
|vk_f1 ... vk_f12||keycode for the function keys F1 to F12|
|vk_numpad0 ... vk_numpad9||number keys on the numeric keypad|
|vk_multiply||multiply key on the numeric keypad|
|vk_divide||divide key on the numeric keypad|
|vk_add||key on the numeric keypad|
|vk_subtract||subtract key on the numeric keypad|
|vk_decimal||decimal dot keys on the numeric keypad|
The following constants can only be used with keyboard_check_direct():
|vk_lshift||left shift key|
|vk_lcontrol||left control key|
|vk_lalt||left alt key|
|vk_rshift||right shift key|
|vk_rcontrol||right control key|
|vk_ralt||right alt key|
The following is a small example of how to use the vk_ constants:
The above code will detect if the 'Tab' key is pressed and create an instance of object 'obj_Menu' if it is.
For information on the available GameMaker: Studio keyboard functions, please see the following sections of the manual:
© Copyright YoYo Games Ltd. 2018 All Rights Reserved
Sometimes we want to change what a mouse button can do. You can buy a mouse with 5 or more buttons for around rs500. The extra buttons can be made to act like a left mouse click or give a keyboard action. This is called remapping the buttons.
Some people who have problems with their hands may find this helpful. You may get pain in your hands (like I do from arthritis) or you may have weak hands. Or some other reason.
These programs can help you make your mouse easier to use. These are for Microsoft Windows computers and laptops. They are free! You can see a longer review here: https://www.raymond.cc/blog/changing-and-customizing-your-mouse-buttons-actions/.
X-Mouse Button Control
https://www.highrez.co.uk/downloads/xmousebuttoncontrol.htm “X-Mouse Button Control” free mouse button remapper can change up to 5 buttons.
https://realityripple.com/Software/Applications/Mouse-Manager/ Mouse Manager for remapping mouse up to 5 buttons https://realityripple.com/download.php?id=MMGR actual program download . or pay for a more complex version.
This is a little different but can do SO much more. It is a brilliant program and worth the effort to get to know.
https://autohotkey.com/docs/misc/Remap.htm uses autohotkey will do mouse buttons. You can make this specific to one or two programs if you want to. For example, make the button 5 open your email program when using the web browser.
Some say this is easy others say you need to do the actions that you want the button click to do. Worth trying if the others do not help you.
Sometimes it is useful to change the keyboard to suit your needs. Using the Tab key is one more action that may be difficult or may cause pain. If you do not use the CapLocks key often you can swap the Caplocks and Tab keys. Many other changes are possible. You need to think about what is difficult-painful. Then think what you could do instead that is easier or less painful. Hopefully one of these programs may let you then change your keyboard as you want to.
Autohotkey is excellent for this. You can have spelling mistakes automatically corrected. You can get a $ written when you press the letter e 3 times. You can automatically make a word you commonly use start with a capital letter eg a name. There is a ready made list of spelling mistakes that it will correct that you can download and use. This article gives details on using it for spelling correction http://www.computoredge.com/AutoHotkey/Add_AutoCorrection_to_Your_Windows_PC_with_AutoHotkey.html.
You do need to feed in the changes that you want. Then you need to remember the shortcuts you used! The more shortcuts the more this can be a challenge for phrases or actions. But once you get the hang of this – you will wish you found it years ago.
This can make changes that affect ALL programs. Or you can make them specific to one or two programs. So “yo si” in your email program may write out:
Mr Mickie Mouse
Actor in Walt Disney Movies”
But use the same in the browser and it types
For much more information do go to their site https://autohotkey.com/docs/AutoHotkey.htm.
https://www.bleepingcomputer.com/download/keytweak/ for the keyboard. This uses the registry to change what a key on your keyboard does. I am not sure if it changes mouse buttons. Once this is changed you can undo it but it will effect all programs you use.
You can use Autokey – which you can install using the program managers eg Synaptic if you use Ubuntu or Mint or related operating systems. It is excellent and will do a lot (if not all) that autohotkey will use.
Sorry, I am not familiar with what is available for Mac users.
How To Set X-mouse Button Control To Numbers Letters Free
There is software available that can make it easier to use your mouse and keyboard. Make them suit your hands and what you can do. Try these out and see if they make things easier or quicker for you.