Hello,
I've just started using JCEF on linux and the first feature I'm trying to implement is zoom in/out but I'm not getting anywhere. I'm new to desktop application development so I'm not sure where the problem is me or JCEF, I'd appreciate some guidance...
Attempt 1.
Adjust zoom in response to ctrl+mouse wheel events. I thought this would be simple, its a standard feature, but I can't for the life of me find a way to capture mouse scroll wheel events when the mouse is over the browser component. Upon debugging I can see the events aren't even making it into sun.awt.X11.XToolkit, beyond there I'm lost for what's going on.
Attempt 2.
I'll capture ctrl+ and ctrl- and do zoom with that, not ideal but this is a spare time project so I need to keep moving.
The problem is that CefKeyEvent.character/unmodified_character is 11 (VT) for control-minus and 13 (CR) for control-plus. I'm pretty sure control-minus is not vertical tab and control-plus is definitely not a carriage return, so I'm stuck due to clashes with actual carriage return.
Next I've tried to use the keycode, but '_' / '-' have the same keycode (being the same physical key) and numpad '-' is a different keycode entirely. So the keycode appears to reflect the physical key on the keyboard, rather than the character being input, so coding to this will presumably break for different keyboard layouts?
Any advice on how I might make either or both of these approaches work would be much appreciated, I'm developing for linux first but my code will need to be portable for win/mac. Thanks.