Using Function Key with Type()

Asked by sandra hulme

I want to close a window in the application I am testing using CTRL+F4 because this window has no Close or OK button. My thought was to use the Type() command with KEY_CTRL and KEY_F4, but Sikuli does not appear to recognise KEY_F4.

Can you tell me what the syntax should be within the () of the Type command in order to do this. I could not find any examples of using Type() with a function key.

I am using Sikuli 0.10.2.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

the F4 is the text input (usage as constant from class Key), that is accompanied with the key modifier CTRL.

so it has to be written as:
type(Key.F4, KEY_CTRL)

I just found that the doc should have some typical examples, to make things clearer.

Revision history for this message
sandra hulme (sandra-hulme) said :
#2

Thanks, that's great.