im trying to use sendkey to browser and i need to simulate that the shift key is down programmely, but i can't get it to work!
here is the code:
self.browser.SendKeyEvent(cefpython.KEYTYPE_KEYDOWN,self.keyInfo(cefpython.VK_TAB),cefpython.KEY_SHIFT)
I have also tried adding following code before the tab send key, withou luck:
self.browser.SendKeyEvent(cefpython.KEYTYPE_KEYDOWN,self.keyInfo(cefpython.VK_LSHIFT),0)
what im trying to get the code to do, is tab down when i press the down arrow on the keyboard, and then i want it to tab back up when the up key is pressed!
help please, how do this?
cheers
c_bb
thanks for the reply. I have tried all of those methods without any luck, i forgot to mention that self.keyinfo returns the tuble like (cefpython.VK_TAB, false, false).
The funny thing is that even if i set the modifier the sendkey acts like a normal tab, tabbing down the page, it's like it doesn't register that the modifier is set and it need to simulate the shift key!
cheers
c_bb
The funny thing is that even if i set the modifier the sendkey acts like a normal tab, tabbing down the page, it's like it doesn't register that the modifier is set and it need to simulate the shift key!
i tried:
SendKeyEvent(cefpython.KEYTYPE_KEYDOWN, (cefpython.VK_SHIFT, false, false), 0);
SendKeyEvent(cefpython.KEYTYPE_KEYDOWN, (cefpython.VK_TAB, false, false), cefpython.VK_SHIFT);
no luck! all is does is send a normal tab to the browser, so that the diplay page tabs down the page!
regarding your cefclient, off-screen rendering example, that works fine and i can also my code to tab back up the page if i *manually* hold down the shift key and use the sendkey to send the cefpython.VK_TAB, but that is not what i want! i want the up key on the key board to simulate a shift+tab key stroke, so when i press the up key on the keyboard the page displayed will tab upwards! hope it makes sence!
>You haven't answered my question, whether sending shift key works in a textarea.
I tried to send following code to the browser, while focused in textbox:
SendKeyEvent(cefpython.KEYTYPE_KEYDOWN, (cefpython.VK_A, False, False), cefpython.VK_SHIFT)
nothing happened! also tried:
SendKeyEvent(cefpython.KEYTYPE_KEYDOWN, (cefpython.VK_A, False, False), 0)
nothing happened!
> but it works when you simulate KEYTYPE_KEYDOWN for shift?
Don't know, nothing really happens when i send the shift key alone, so i can't see if that works or not! but i guess so!
cheers
c_bb
i also tried:
SendKeyEvent(cefpython.KEYTYPE_CHAR, (cefpython.VK_A, False, False), 0)
and that sends a capital A too, even though shift is not send with it!
cheers
c_bb