FKiSS General Syntax

See also: FKiSS, Data Types, If-Endif Structure, Shortcuts, %Tags, Cel Groups, Value Pools, HINTs, Events, Actions

FKiSS Line Format

All FKiSS lines must start with the characters ;@. There may be additional space between the @ and the FKiSS commands and multiple commands may appear on a single line but the first two characters of the line must be ;@ or the line will not be recognized as FKiSS code.

Declaring FKiSS Usage

Before any FKiSS code is listed, you must include this line:
;@EventHandler
This line must appear exactly as shown here. It is case-sensitive so ;@eventhandler or ;@EVENTHANDLER are not acceptable.
It is permissible to use ;@EventHandler() although the () is not necessary. Nothing else should appear on this line.
This line should appear only once in a CNF file.

FKiSS Commands

An FKiSS command can take a variety of data types, depending on the type of command.
FKiSS commands come in two types:

Events:

An event command specifies the conditions under which a sequence of action commands are executed. All actions listed after an event command are assumed to be part of that event until the next event command is listed.

Examples:

;@ press("button.cel") ; Start of event when button.cel is clicked
;@   move(#37, 24, -10)
;@   move(#38, 1, 0)

;@ alarm(5)            ; Start of alarm 5 event
;@   map("happy.cel")
;@   unmap("sad.cel")

Actions

An Action is a command which is immediately executed in response to an event. An action can change a cel from mapped to unmapped or change its color. An action can move an object to a new location or change the value of a variable. Actions cover a wide-range of functionality.
All actions must belong to an FKiSS event.

Examples:

;@ map("hat.cel")     ; Map the cel "hat.cel" to the current set (make it visible).
;@ move(#37, 24, -10) ; Move object #37 to the right 24 and up 10.
;@ let(X, 5)          ; Assign the value 5 to the variable X.

Command Formatting

More than one FKiSS command can occur on a single line, separated by spaces. The first command on the line doesn't have to be an event but it is usually easier to read if you do it that way. No matter what however, an event command must come before any action commands.

Examples:

This layout puts all of the actions for an event on subsequent lines that are indented one or two spaces and each event is separate by a blank line. This makes for more lines in the CNF but the FKiSS code is easier to read.
;@ press("button.cel")
;@   move(#37, 24, -10)
;@   move(#38, 1, 0)

;@ alarm(5)
;@   map("happy.cel")
;@   unmap("sad.cel")

This layout puts all of the actions for an event on the same line so only events appear at the beginning. This works best if the number of actions is small (this is the same example as above).
;@ press("button.cel") move(#37, 24, -10) move(#38, 1, 0)
;@ alarm(5) map("happy.cel") unmap("sad.cel")

This is a minor alternate showing that the space after the ;@ is not needed.
;@alarm(5) map("hat.cel") move(#37, 24, -10)

This example shows that multiple events can be specified on the same line (the alarm and press events). Be aware that this layout is very hard to read.
;@alarm(5) map("hat.cel") press(#1) let(X, 5)

Wrong:

;@alarm(5)map("hat.cel")move(#37, 24, -10)     ; Spaces must appear between actions
;@alarm(5) @map("hat.cel") @move(#37, 24, -10) ; @ must appear only at the start of the line