1
0
Fork 0

setCursor: complain and show options if wrong cursor name was given

This commit is contained in:
mfranz 2008-11-20 23:03:24 +00:00
parent 8d7545252f
commit 2b77665c22

View file

@ -62,7 +62,10 @@ var setCursor = func(x = nil, y = nil, cursor = nil) {
if (x != nil) args.getNode("x", 1).setIntValue(x);
if (y != nil) args.getNode("y", 1).setIntValue(y);
if (cursor != nil) {
if (num(cursor) == nil) cursor = cursor_types[cursor];
if (num(cursor) == nil)
cursor = cursor_types[cursor];
if (cursor == nil)
die("cursor must be one of: " ~ string.join(", ", keys(cursor_types)));
setprop("/sim/mouse/hide-cursor", cursor);
args.getNode("cursor", 1).setIntValue(cursor);
}