Request for a Hotkey
Posted: Thu Jul 05, 2018 10:06 am
Hello. I posted the following to a different forum. But I'd like to re-post it here in case anyone here may find the following hotkey useful.
I have now completed my first project using Spread32. I really appreciate its simplicity and want to say thank you very much.
There is one suggestion I'd like to ask you to consider. I very much prefer to use the keyboard instead of the mouse as much as possible.
I find that I can do almost everything I need with Spread32 using the keyboard - except for one thing. I find that I often need to move my cursor from some cell to the edit box on the top of the spreadsheet so that I can edit an existing formula. I sure do wish there was some "hotkey" like maybe the Escape key or maybe some other key that is rarely used - like perhaps the backslash? "\" or one of the function keys?
Even better, would it be possible to enable users to choose the key for themselves? In that way, we could define the keys we would prefer to use? I'd love to have one key that I could choose that would instantly move the cursor from any cell or anywhere else directly to the "formua box" at the top of the spreadsheet.
For example, I see that you do define certain hotkeys like "Ctrl-1" which is equivalent to "Format Cells". It would be wonderful if you had another key that would be called something like "Jump to edit box" - especially if people could choose for themselves just which key combinations they'd like to use. Combinations like "Alt-Ctl-J" or even "Shift-Alt-Ctl-F" for example. The best user-defined hotkeys enable people to use up to 3 different modifier keys in a single definition. I know that you only have a very tiny number of hotkeys in use. But it would be so wonderful if you could add a few more for all of us keyboard afficionados.
Thank you very much for your consideration.
-------------------------------------------------------------------------------------------------------------------------------------------------
ALISHIBAZ
Posts 4
2 minutes ago #2
After making the above post, it occurred to me that some other people might also find it useful to use a hotkey that instantly causes the cursor to jump to the edit box at the top of the spreadsheet.
One of the most wonderful Windows freeware utilities I have ever used is a language that enables people to create their own hotkeys. It is a full programming language. But it can also be used to create just a few simple hotkeys. I decided to post an example of the hotkey I created which uses the backslash "\" to cause the cursor to jump to the edit box at the top of the spreadsheet.
I should begin by telling you that Autohotkey has a web site and you can easily download the free version of the utility there. It is: https://www.autohotkey.com
There is no "catch" to this product. It is completely free. It never asks you to send them money. You just go to that web site and download the current version of AHK (AutoHotKey). Then you install it and the entire process is very quick and very easy.
One of the tools that comes with AHK is a "spy" program. I will just tell you that one of the capabilities of that tool is that you can move the mouse cursor anywhere on the screen and it will tell you the exact position of the cursor in pixels. I used it to find the mouse position of the edit box is 42, 57. That means the x-co-ordinate is 42 pixels and the y-co-ordinate is 57 pixels.
I will now show you the code required to transform the backslash key into a hotkey that moves the mouse cursor instantly to a position in the edit box at the extreme left. Here are the five lines required to achieve this hotkey:
---------------------------------------
\::
Coordmode Mouse,Screen
Click 42,57
Coordmode Mouse,Relative
RETURN
---------------------------------------
The first line means that you are creating a macro that will be invoked every time you tap the backslash key.
The second line uses the command "Coordmode". This command enables you to choose whether you want to reference pixels in the active window or on the entire screen.
I chose to use the full screen. So "Click 42,57" means to move the cursor to a point on the screen that is 42 pixels to the right of the upper left corner and 57 pixels down from the upper corner.
You can look up this command in the User Guide to learn its fine points. But its not really necessary. It's really very simple. It just enables you to choose from two options when specifying any position to move the mouse.
The fourth line is "Coordmode Mouse,Relative". This command just restores the system to use the active window whenever someone specifies a pair of pixel co-ordinates.
The "RETURN" command signals the end of the hotkey macro.
---------------------------------------
I will now show you a few examples of simple hotkeys so that you can get the idea if this language is something that may appeal to you. Here is an example of four hotkey definitions that map four key combinations to the cursor keys. You might use these definitions if you have some reason for not wanting to use the cursor keys.
In AHK, when defining a key combination, it uses the following four characters to signify the four modifier keys: ALT, CTL, SHIFT, WIN.
! - ALT
^ - CTL
+ - SHIFT
# - WIN
The following four lines demonstrate the use of "single line" hotkeys. Whenever you define a hotkey you can define that hotkey with a single line or with multiple lines. The following four lines each define a keystroke combination that can be used in place of one of the four cursor keys:
^m::sendinput {UP}
^,::sendinput {LEFT}
^.::sendinput {RIGHT}
^/::sendinput {DOWN}
The 1st line changes the meaning of CTL-m. Whenever you press CTL-m, the effect will be the same as pressing the UP cursor key. The idea is that you can use the key sequence "CTL-M" to simulate pressing the "up cursor key".
Once you define the key sequence "CTL-m" as the UP cursor key, everytime you press the CTL-m key, the PC will react as if you have pressed the UP cursor key. This is no real earth-shattering event. But in many cases, you will find that you can do many wonderful things by defining your own hotkeys. For example, I have found many excellent techniques that I can accomplish by defining certain hotkeys using the AHK language. I hope you will decide to give this utility a chance. If you do. I think you will find that you can accomplish many excellent productivity enhancements by using this tool. I can tell you - with no reservation at all - if I was stranded on a desert island and could use only one PC applications, it would be - without a doubt - Auto HotKey. I have used this language to accomplish many wonderful things. One of my most favorite activities is to use AHK to simulate employing hundreds of people to each enter contests or purchase concert tickets. I have won several great prizes because I am able to submit many multiple entries in a very short period of time and in this way, I can get several great advantages over other people who are limited to submitting orders or contest entries - limited to the speed at which they can enter such contests. I can create "bots" (aka "robots") who can submit hundreds of entries in a few seconds so that I can essentially jump to the front of the line and buy out hundreds of concert tickets before anyone else is ever able to buy one such ticket. Is that cheating? I don't know. Is it fun? Oh my Gosh It's a riot and I love it.
Have you ever wondered why you are never able to purchase any concert tickets for your favorite performers? Have you ever wondered why a very few select number of people seem to be able to "snap up" almost every single ticket as soon as they go on sale? It may not be fair. But, it's a wonderful tool and if you use it correctly, you can multiply your abilities hundreds or thousands of times and I think it's safe to say that you will absolutely love this tool. If you rely on using spreadsheets, I think it's safe to say that you will be able to do all kinds of terrific stuff with your spreadsheets by using them together with some Hotkey Language. The best thing about this language? It is completely free. You never have to give me (or anyone else) any money. Honest! Well .... almost honest anyways. You can send me a Private Message if you want to know more. But you really don't need to send me anything private. Please be assured. I will never ask you for any money and no one else will either. Honest! Never! I promise!
In the above sample code:
The 2nd line changes the meaning of CTL-, (CTL-comma) as follows: Whenever you press CTL-,Comma, the effect will be the same as pressing the LEFT cursor key.
The 3rd line changes the meaning of CTL., (CTL-period) as follows: Whenever you press CTL-Period, the effect will be the same as pressing the RIGHT cursor key.
The 4th line changes the meaning of CTL/, (CTL-slash) as follows: Whenever you press CTL-Slash, the effect will be the same as if you pressed the DOWN cursor key.
---------------------------------------
Well, that's just about it. AHK is truly very simple and a real marvel. I just wanted to give you the basic idea of how to create your own hotkeys and then use them in conjunction with some other app.
If you have any questions, AHK has a very enthusiastic and friendly user forum and if you post your questions there, I'm quite certain the AHK users will be glad to try and help you. Please feel free to experiment with the "SPY tool" and with pixel co-ordinates. You can easily adjust them if you find that 42, 57 may not be the very best co-ordinates for you to use.
Have Fun and always remember ...... "Keep a stiff upper lip"! Ain't that what they mean by the name, ""Stiffie"? I think it probably may well be.
I have now completed my first project using Spread32. I really appreciate its simplicity and want to say thank you very much.
There is one suggestion I'd like to ask you to consider. I very much prefer to use the keyboard instead of the mouse as much as possible.
I find that I can do almost everything I need with Spread32 using the keyboard - except for one thing. I find that I often need to move my cursor from some cell to the edit box on the top of the spreadsheet so that I can edit an existing formula. I sure do wish there was some "hotkey" like maybe the Escape key or maybe some other key that is rarely used - like perhaps the backslash? "\" or one of the function keys?
Even better, would it be possible to enable users to choose the key for themselves? In that way, we could define the keys we would prefer to use? I'd love to have one key that I could choose that would instantly move the cursor from any cell or anywhere else directly to the "formua box" at the top of the spreadsheet.
For example, I see that you do define certain hotkeys like "Ctrl-1" which is equivalent to "Format Cells". It would be wonderful if you had another key that would be called something like "Jump to edit box" - especially if people could choose for themselves just which key combinations they'd like to use. Combinations like "Alt-Ctl-J" or even "Shift-Alt-Ctl-F" for example. The best user-defined hotkeys enable people to use up to 3 different modifier keys in a single definition. I know that you only have a very tiny number of hotkeys in use. But it would be so wonderful if you could add a few more for all of us keyboard afficionados.
Thank you very much for your consideration.
-------------------------------------------------------------------------------------------------------------------------------------------------
ALISHIBAZ
Posts 4
2 minutes ago #2
After making the above post, it occurred to me that some other people might also find it useful to use a hotkey that instantly causes the cursor to jump to the edit box at the top of the spreadsheet.
One of the most wonderful Windows freeware utilities I have ever used is a language that enables people to create their own hotkeys. It is a full programming language. But it can also be used to create just a few simple hotkeys. I decided to post an example of the hotkey I created which uses the backslash "\" to cause the cursor to jump to the edit box at the top of the spreadsheet.
I should begin by telling you that Autohotkey has a web site and you can easily download the free version of the utility there. It is: https://www.autohotkey.com
There is no "catch" to this product. It is completely free. It never asks you to send them money. You just go to that web site and download the current version of AHK (AutoHotKey). Then you install it and the entire process is very quick and very easy.
One of the tools that comes with AHK is a "spy" program. I will just tell you that one of the capabilities of that tool is that you can move the mouse cursor anywhere on the screen and it will tell you the exact position of the cursor in pixels. I used it to find the mouse position of the edit box is 42, 57. That means the x-co-ordinate is 42 pixels and the y-co-ordinate is 57 pixels.
I will now show you the code required to transform the backslash key into a hotkey that moves the mouse cursor instantly to a position in the edit box at the extreme left. Here are the five lines required to achieve this hotkey:
---------------------------------------
\::
Coordmode Mouse,Screen
Click 42,57
Coordmode Mouse,Relative
RETURN
---------------------------------------
The first line means that you are creating a macro that will be invoked every time you tap the backslash key.
The second line uses the command "Coordmode". This command enables you to choose whether you want to reference pixels in the active window or on the entire screen.
I chose to use the full screen. So "Click 42,57" means to move the cursor to a point on the screen that is 42 pixels to the right of the upper left corner and 57 pixels down from the upper corner.
You can look up this command in the User Guide to learn its fine points. But its not really necessary. It's really very simple. It just enables you to choose from two options when specifying any position to move the mouse.
The fourth line is "Coordmode Mouse,Relative". This command just restores the system to use the active window whenever someone specifies a pair of pixel co-ordinates.
The "RETURN" command signals the end of the hotkey macro.
---------------------------------------
I will now show you a few examples of simple hotkeys so that you can get the idea if this language is something that may appeal to you. Here is an example of four hotkey definitions that map four key combinations to the cursor keys. You might use these definitions if you have some reason for not wanting to use the cursor keys.
In AHK, when defining a key combination, it uses the following four characters to signify the four modifier keys: ALT, CTL, SHIFT, WIN.
! - ALT
^ - CTL
+ - SHIFT
# - WIN
The following four lines demonstrate the use of "single line" hotkeys. Whenever you define a hotkey you can define that hotkey with a single line or with multiple lines. The following four lines each define a keystroke combination that can be used in place of one of the four cursor keys:
^m::sendinput {UP}
^,::sendinput {LEFT}
^.::sendinput {RIGHT}
^/::sendinput {DOWN}
The 1st line changes the meaning of CTL-m. Whenever you press CTL-m, the effect will be the same as pressing the UP cursor key. The idea is that you can use the key sequence "CTL-M" to simulate pressing the "up cursor key".
Once you define the key sequence "CTL-m" as the UP cursor key, everytime you press the CTL-m key, the PC will react as if you have pressed the UP cursor key. This is no real earth-shattering event. But in many cases, you will find that you can do many wonderful things by defining your own hotkeys. For example, I have found many excellent techniques that I can accomplish by defining certain hotkeys using the AHK language. I hope you will decide to give this utility a chance. If you do. I think you will find that you can accomplish many excellent productivity enhancements by using this tool. I can tell you - with no reservation at all - if I was stranded on a desert island and could use only one PC applications, it would be - without a doubt - Auto HotKey. I have used this language to accomplish many wonderful things. One of my most favorite activities is to use AHK to simulate employing hundreds of people to each enter contests or purchase concert tickets. I have won several great prizes because I am able to submit many multiple entries in a very short period of time and in this way, I can get several great advantages over other people who are limited to submitting orders or contest entries - limited to the speed at which they can enter such contests. I can create "bots" (aka "robots") who can submit hundreds of entries in a few seconds so that I can essentially jump to the front of the line and buy out hundreds of concert tickets before anyone else is ever able to buy one such ticket. Is that cheating? I don't know. Is it fun? Oh my Gosh It's a riot and I love it.
Have you ever wondered why you are never able to purchase any concert tickets for your favorite performers? Have you ever wondered why a very few select number of people seem to be able to "snap up" almost every single ticket as soon as they go on sale? It may not be fair. But, it's a wonderful tool and if you use it correctly, you can multiply your abilities hundreds or thousands of times and I think it's safe to say that you will absolutely love this tool. If you rely on using spreadsheets, I think it's safe to say that you will be able to do all kinds of terrific stuff with your spreadsheets by using them together with some Hotkey Language. The best thing about this language? It is completely free. You never have to give me (or anyone else) any money. Honest! Well .... almost honest anyways. You can send me a Private Message if you want to know more. But you really don't need to send me anything private. Please be assured. I will never ask you for any money and no one else will either. Honest! Never! I promise!
In the above sample code:
The 2nd line changes the meaning of CTL-, (CTL-comma) as follows: Whenever you press CTL-,Comma, the effect will be the same as pressing the LEFT cursor key.
The 3rd line changes the meaning of CTL., (CTL-period) as follows: Whenever you press CTL-Period, the effect will be the same as pressing the RIGHT cursor key.
The 4th line changes the meaning of CTL/, (CTL-slash) as follows: Whenever you press CTL-Slash, the effect will be the same as if you pressed the DOWN cursor key.
---------------------------------------
Well, that's just about it. AHK is truly very simple and a real marvel. I just wanted to give you the basic idea of how to create your own hotkeys and then use them in conjunction with some other app.
If you have any questions, AHK has a very enthusiastic and friendly user forum and if you post your questions there, I'm quite certain the AHK users will be glad to try and help you. Please feel free to experiment with the "SPY tool" and with pixel co-ordinates. You can easily adjust them if you find that 42, 57 may not be the very best co-ordinates for you to use.
Have Fun and always remember ...... "Keep a stiff upper lip"! Ain't that what they mean by the name, ""Stiffie"? I think it probably may well be.