Wiki Update: Manipulate a Window

Submitted for your review, comment, and/or revision, the following Wiki article has been updated:
###action:Manipulate a Window [Keyboard Maestro Wiki]

###Change:

  • Add statement and screenshots to indicate units are in points, not pixels.

<img src="/uploads/default/original/2X/9/9fa034801953dfe7d1745afcb7087c7530a06e23.gif" width="70" height="17"> 2016-07-16 14:16 CT

* Removed the reference to points
* [Per Peter,](https://forum.keyboardmaestro.com/t/wiki-update-manipulate-a-window/4225/6?u=jmichaeltx) the screens and windows are in units of "nominal resolution pixels"
* The text and screenshots have been revised to reflect this.
1 Like

Does Apple use “Points” in this way? I couldn’t find any reference that uses that terminology. The Display preference uses resolution as either:

1920 x 1200
or
960 x 600 (HiDPI)

But no mention of either pixels or points.

It is accurate to say that all coordinates used in Keyboard Maestro are based on what the API calls “Nominal Resolution” which is the low-dpi pixel coordinate made up of four high DPI pixels on HuDPI displays.

I can’t use the term “Points” since most people would have no idea what that means.

So I agree it is worth noting, but not necessarily by referring to “points” which I don’t hing will be understood by most people.

We were just following the statement provided in the function:SCREEN [Keyboard Maestro Wiki]

SCREEN sizes and positions are in “points” (so a retina screen will typically have half as many points as pixels).

Use whatever term you think best.

Seems like that could be the basis for providing clarification.

Something like:

*** DRAFT *** *** DRAFT *** *** DRAFT ***
All Keyboard Maestro screen and window Actions and Functions are based on "Nominal Resolution" screens that have about 92 pixels per inch (ppi). Keyboard Maestro will refer to the units as "pixels".

If you are using a Mac with a Retina screen, then you will need to divide the physical pixel count by 2. In other words:

Keyboard Maestro Pixels := Nominal Resolution Pixels = (Retina Pixels)/2

To determine the pixels as reported and used by Keyboard Maestro on your Mac, execute this Action in a Macro:
(see the function:SCREEN for details.)

The contents of the Display Action are:

Screen #1
%Screen%1%

Left:    %Calculate%SCREEN(1, Left)%
Right:   %Calculate%SCREEN(1, Right)%
Top:     %Calculate%SCREEN(1, Top)%
Bottom:  %Calculate%SCREEN(1, Bottom)%
Width:   %Calculate%SCREEN(1, Width)%
Height:  %Calculate%SCREEN(1, Height)%
MidX:    %Calculate%SCREEN(1, MidX)%
MidY:    %Calculate%SCREEN(1, MidY)%

I'm not saying the above is 100% accurate. Just providing a straw draft to facilitate discussion and convergence on what should be in the Wiki.

Here are a couple of interesting references:

  1. Retina Display - Wikipedia, the free encyclopedia
  2. Using a Retina display - Apple Support

Something like that sounds good. I’ll leave the actions as pixels, which I think is the only term most people are going to understand.

I imagine there are cases where they are other ratios than Retina (2:1) and normal low DPI (1:1) if scaling is set to other settings. If there aren’t yet cases where that can happen, I’m sure there will be. Hopefully Keyboard Maestro works properly in all cases, though it becomes hard to test.

The wiki could mention “Points” as a possible synonym for these non-hardware pixel concepts, though I’ve mostly only seen that in relation to text.

Per Peter's request, I have updated this Wiki article:

https://wiki.keyboardmaestro.com/action/Manipulate_a_Window