User Guide

404 Chapter 18: Code
dreamweaver.getKeyState()
Availability
Dreamweaver 3.
Description
Determines whether the specified modifier key is depressed.
Arguments
key
The key argument must be one of the following values: "Cmd", "Ctrl", "Alt", or "Shift". In
Windows,
"Cmd" and "Ctrl" refer to the Control key; on the Macintosh, "Alt" refers to the
Option key.
Returns
A Boolean value that indicates whether the key is pressed.
Example
The following code checks that both the Shift and Control keys (Windows) or Shift and
Command keys (Macintosh) are pressed before performing an operation:
if (dw.getKeyState("Shift") && dw.getKeyState("Cmd")){
// execute code
}
dreamweaver.getNaturalSize()
Availability
Dreamweaver 4.
Description
Returns the width and height of a graphical object.
Arguments
url
The url argument points to a graphical object for which the dimensions are wanted.
Dreamweaver must support this object (GIF, JPEG, PNG, Flash, and Shockwave). The URL
that is provided as the argument to the
getNaturalSize() function must be an absolute URL
that points to a local file; it cannot be a relative URL.
Returns
An array of two integers where the first integer defines the width of the object, and the second
defines the height.
000_DW_API_Print.book Page 404 Wednesday, August 20, 2003 9:14 AM