How to use keys of HOME and SHIFT to select text --- Num_Lock must be off

Asked by Stranger

**** solution

switch it off manually

or (currently only works on Win10 (see related bug))

- check NUM_LOCK state with Key.isLockOn(Key.NUM_LOCK)
- if True (toggle is on) switch it off using type(Key.NUM_LOCK)

-----------------------------------

I want to select one line text in script by combined keys of HOME and SHIFT, but it dosen't work.
My script is :
type(Key.END)
wait(1)
type(Key.HOME, Key.SHIFT)
wait(1)
type('C', Key.CTRL)
wait(1)
print Env.getClipboard()

But from UI, the line text can't be selected. Is there any problem in my script? Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1
Revision history for this message
Stranger (peterlee007) said :
#2

But if I run fucntion Env.isLockOn(Key.NUM_LOCK), SikuliX will be exited from process automatically. Why?

Revision history for this message
Stranger (peterlee007) said :
#3

My SikuliX version is V1.1.1

Revision history for this message
RaiMan (raimund-hocke) said :
#4

please paste you snippet.
What Windows, Java?

Revision history for this message
Stranger (peterlee007) said :
#5

            if Env.isLockOn(Key.NUM_LOCK):
                nlZap=True
            else:
                nlZap=False
            if nlZap:
                type(Key.NUM_LOCK)
            type(Key.HOME)
            wait(1)
            type(Key.END, Key.SHIFT)
            wait(1)
            type('C', Key.CTRL)
            eStr = Env.getClipboard()

This is my script. But when script run at first line, SikuliX will be exited automatically.
My OS is Win7,32bit, Java is Version 8 Update 121(build 1.8.0_121-b13)

Revision history for this message
RaiMan (raimund-hocke) said :
#6

ok, thank you.
I have to check the situation on Windows 7.

Revision history for this message
Stranger (peterlee007) said :
#7

Hello, have you confirmed it is one issue?

Revision history for this message
Stranger (peterlee007) said :
#8

Any update about this issue?

Revision history for this message
Stranger (peterlee007) said :
#9

Any update about this issue?

Revision history for this message
RaiMan (raimund-hocke) said :
#10

Sorry, I missed that.

I do not have a Win 7 available currently.

I tested on Win 10-64 and it works as it should.

I used the latest 1.1.3 nightly.

Revision history for this message
RaiMan (raimund-hocke) said :
#11

I found the problem with Windows 7.

It will be fixed with 1.1.4

… until then you have to use the manual solution, sorry.

Can you help with this problem?

Provide an answer of your own, or ask Stranger for more information if necessary.

To post a message you must log in.