<br><br><div class="gmail_quote">On Thu, Feb 23, 2012 at 3:54 PM, Kristian Hoegsberg <span dir="ltr"><<a href="mailto:hoegsberg@gmail.com">hoegsberg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Feb 22, 2012 at 02:21:41PM -0700, Scott Moreau wrote:<br>
> Ideally, we would want to use <modifier>+Scroll binding but that will have<br>
> to wait for axis events. For now we just use keybindings. Zoom in/out with<br>
> Super+Up/Down.<br>
<br>
</div>Applied with a minor edit to really fix the code-before-declaration<br>
thing. With your change we still end up with<br>
<br>
weston_output_update_zoom(struct weston_output *output, int x, int y)<br>
{<br>
<div class="im"> if (output->zoom.level <= 0)<br>
</div> return;<br>
<br>
float ratio;<br>
...<br>
<br>
That is, the ratio variable is declared after the if statement.<br>
That's what we don't want.<br></blockquote><div><br>Ah ok. So all declarations should come before code. Clearly I didn't pay attention to the meaning of code-before-declaration.<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Anyway, enough nit-picking, it works well where, but we need to fix<br>
the binding issue. We need to swallow the key press that triggers the<br>
binding and we also need to swallow the corresponding key up. What<br>
I've been thinking is that we could let the binding handler return a<br>
value to indicate whether or not to swallow the event. The tricky<br>
part is going to be swallowing the release event, since that may come<br>
many key events later. We could just maintain a per-device list of<br>
"keys that are down, and we need to swallow the release event", but<br>
that's kinda gross. I don't really think there's a nicer way though.<br>
And all this applies to pointer buttons as well.<br>
<span class="HOEnZb"><font color="#888888"><br>
Kristian</font></span><br></blockquote></div><br>Yes, this is a problem with all keybindings currently. I was thinking the same about eating the actual keybinding when the pressed/clicked but I hadn't given much thought about the corresponding release event(s). It does seem like we'd need some kind of state tracking for this. I haven't looked into it yet but maybe when a binding is detected, we could set something (possibly on the binding list or similar?) to listen for release of the events involved. I haven't given much thought to this nor have I looked into it yet but will do so.<br>
<br>Also, is this a blocker? I don't see the patch in weston yet.<br><br><br>Thanks,<br><br>Scott<br>