beetlebug▾
/

ztk::game pressed

Gives 1 when the action was pressed since the step before this step.

ztk::game pressed NAME

Description

The events between two steps set the state that the next step reads. The later steps of the same frame give 0.

Returns

1 or 0.

Examples

% ztk::game action jump -keys space
> event generate . <KeyPress-space>
> ztk::game step
> ztk::game pressed jump
1

Errors

% ztk::game pressed nosuch
no action "nosuch"
-errorcode ZTK GAME ACTION nosuch

% ztk::game pressed
wrong # args: should be "ztk::game pressed name"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.7

See also