Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboard is weird #8

Closed
ofZach opened this issue Jan 5, 2015 · 6 comments
Closed

keyboard is weird #8

ofZach opened this issue Jan 5, 2015 · 6 comments

Comments

@ofZach
Copy link
Owner

ofZach commented Jan 5, 2015

there's some work to be done to get backspace / enter / tab etc all working. ascii / letter keys seem ok

@smallfly
Copy link
Collaborator

for me the keys '3' and '5' do not work and the '0' seems to be interpreted as a space.

@smallfly
Copy link
Collaborator

Did you see any good resources showing who to handle keyboard events?

I have again looked at both ofxCEFClient and CEF3SimpleSample (and Googled it) but did not find a way to make all the keys work properly. ofxCEFClient does it same way, and it does not work better. And to be honest I did not find where this is done in CEF3SimpleSample.

@ofZach
Copy link
Owner Author

ofZach commented Jan 14, 2015

in cef3simpleSample it's hooked directly into the window, so it's getting window events directly. it looks like we need to do some sort of translation? http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11565&p=20601&hilit=keyboard#p20601

@smallfly
Copy link
Collaborator

I will check this.

In the mean time I got all the numbers, delete (both direction), space bar to work correctly. To do this I used the OF keyPressed and keyReleased events, to have access to a ofKeyEventArgs and the 'scancode'. Then I did this:

CefKeyEvent event;
event.native_key_code = e.scancode;
event.character = (char)e.key;
event.type = KEYEVENT_CHAR;
browser->GetHost()->SendKeyEvent(event);

I did this after looking at the values in the ofKeyEventArgs and at that table showing the keycodes.

@smallfly
Copy link
Collaborator

All this has been pushed to the Develop branch: https://github.com/ofZach/cefWork/tree/develop

Some special keys may need more work. But maybe we could close that issue and open new issues for specific keys later on. Is that OK with you?

@smallfly
Copy link
Collaborator

smallfly commented Feb 3, 2015

Opening specific issues such as #18 #19 #20

@smallfly smallfly closed this as completed Feb 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants