![]() ![]() We’ve done some math and some logical comparisons. Now let’s figure out which third of the screen our current front most window is in. If it’s below the midpoint then we want to snap to the bottom of the screen. If the top corner of our front window is above the mid point of the screen then we probably want to snap to the top of the screen. This uses the Keyboard Maestro IF flow control. Let’s start doing some logical tests of the window relative to the screen. Now we start figuring out where our current front window is on the screen. No need to add another action to do the math or to extract the width from the overall array of dimensions. For example, %Calculate%VarMainScreenVisible.Width/3% calculates the Width of the screen divided by three. ![]() It’s handy because it can calculate specific values of a screen or window. ![]() I think the neat thing about this is the KM %Calculate% function. These are all saved to variables that represent specific X & Y regions of the screen. ![]() There are a few additional KM screen calculations: As you can see below the coordinates are 0,25,3840,1575. I used the %ScreenVisible%Main% token to get the coordinates of the visible screen. This is important because I don’t want to try to move a window under the menu bar. First up, I needed to know the coordinates of the visible screen. I used Keyboard Maestro to help me figure out the grid coordinates.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |