Backspace key in SendKeyEvent method?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Backspace key in SendKeyEvent method?

Postby noisebar » Thu Oct 20, 2011 4:31 pm

I couldn't find too much documentation around the parameters of CefBrowser::SendKeyEvent() method. I had no problem sending normal characters to the off-screen browser. But how do I send keys such as backspace?

Thanks.
noisebar
Newbie
 
Posts: 6
Joined: Fri Oct 07, 2011 4:26 pm

Re: Backspace key in SendKeyEvent method?

Postby noisebar » Thu Oct 20, 2011 6:01 pm

Never mind. I figured it out.
noisebar
Newbie
 
Posts: 6
Joined: Fri Oct 07, 2011 4:26 pm

Re: Backspace key in SendKeyEvent method?

Postby rndbit » Sat Mar 23, 2013 9:00 am

you cared enough to make a post that you figured it out but could not also give a solution for future reference.
now im having same problem. does anyone know how to make backspace work?

Nothing works, tried all combinations:
Code: Select all
CefKeyInfo info;
info.key = VK_BACK;
info.imeChar = true/false;
info.sysChar = true/false;
rndbit
Newbie
 
Posts: 7
Joined: Sat Mar 23, 2013 8:56 am

Re: Backspace key in SendKeyEvent method?

Postby rndbit » Mon Mar 25, 2013 7:41 am

noone has any idea?

from sniffing windows messages i found out:
WM_KEYDOWN 8
WM_CHAR 8
WM_KEYUP 8

8 being VK_BACK or '\b' if you prefer. So i tried sending KT_CHAR in-between KT_KEYDOWN and KT_KEYUP but that makes no difference. mind i do not use windows message loop to detect input therefore i do not have access to actual windows messages (otherwise i would have ripped-off osr example already). All i get is msg that KC_BACK (custom input lib) was pressed. So... Anyone else having custom input handled somehow?
rndbit
Newbie
 
Posts: 7
Joined: Sat Mar 23, 2013 8:56 am

Re: Backspace key in SendKeyEvent method?

Postby fddima » Mon Mar 25, 2013 8:15 am

Using CEF3, SendKeyEvent with KeyEventType = Char and WindowsKeyCode = 8 - works for me as backspace.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Backspace key in SendKeyEvent method?

Postby rndbit » Wed Mar 27, 2013 6:33 am

cef1 here (and cant switch due to missing features i depend on)


Could maybe someone who has cef built test backspace in cef1 off-screen rendering mode?
rndbit
Newbie
 
Posts: 7
Joined: Sat Mar 23, 2013 8:56 am

Re: Backspace key in SendKeyEvent method?

Postby Czarek » Wed Mar 27, 2013 8:59 am

rndbit wrote:cef1 here (and cant switch due to missing features i depend on)


Could maybe someone who has cef built test backspace in cef1 off-screen rendering mode?

It works fine in CEF Python Panda3D off-screen rendering example [1]. I've
debugged that example and the key that is sent when I press backspace is 8,
here is the code:

Code: Select all
CefBrowser.SendKeyEvent(KT_CHAR, CefKeyInfo(8, 0, 0), 0);


[1] https://code.google.com/p/cefpython/wiki/Panda3D
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 191 guests