Skip to main content

mapper.enumerate_display_info()

mapper.enumerate_display_info()

This function enumerates information for all displays.

Return Values

This function returns an array of associative array tables described below. The number of elements in the array corresponds to the number of displays connected to the system, with the display number serving as the array index.

KeyTypeDescription
idnumberDisplay number
xnumberThe x-coordinate value of the top-left corner of the display in screen space
ynumberThe y-coordinate value of the top-left corner of the display in screen space
widthnumberThe width of the display
heightnumberThe height of the display
namestringDisplay name
adapterstringName of the graphics adapter to which the display is connected
NOTE

Displays set to “Disconnect this display” in display settings are not included in the table returned by this function. In other words, the elements corresponding to display numbers marked as “Disconnect this display” will be nil.

Note that in such cases, using ipairs() on the returned table may not enumerate all elements. To iterate over all elements, use pairs() instead. Similarly, the # operator cannot be used to obtain the correct number of elements (i.e., the number of active displays).

See Also