Is there a way to combine CTRL and WHEEL_UP to zoom in on web pages?

Asked by Benjamin Bruffey

I am currently trying to use the OCR in sikuli to grab text from a region of the screen and it works perfectly if I have the web page zoomed in. I am wondering if there is a way to do the CTRL + scroll wheel in sikuli and then i know how to revert the zoom back.

I am able to use the GUI components in chrome to do it, but a simple line of code to do the commands would be much simpler and less chance for failure.

I am thinking something like:

type(wheel(region1, WHEEL_UP, 5), KeyModifier.CTRL)

thanks for your help!

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

take care, that the respective window has focus.

keyDown(Key.CTRL)
wheel(WHEEL_UP, 5)
keyUp()

Revision history for this message
Benjamin Bruffey (bruffster) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
Benjamin Bruffey (bruffster) said :
#3

Thanks, so in chrome zooming, it appears that it can't keep track of the 5 scroll movements and only zooms in 3 of the 5 times so i fixed it by just spacing them out with:

wheel(WHEEL_UP,1)
wait(.1)

i did that 5 times and it works like a charm!

Thanks so much!