~ubuntu-branches/debian/sid/openbox/sid

« back to all changes in this revision

Viewing changes to openbox/modkeys.c

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2010-01-01 22:26:10 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100101222610-0ztklegpw2rc2n6q
Tags: 3.4.9-1
* New upstream release
  - Prevent focus from moving under the mouse after activating a window
    with an openbox menu (Closes: #517038)
  - NOTE: this release introduces a new tool named obprop. I did not
    include this tool in the package yet as it has no manual page and it's
    use is probably limited for most users.
* Add libx11-dev to build-depends as it was previously only installed
  as a transitive dependency by other dependencies (Closes: #555787).
* Update install files for libobparser/libobrender as the shared
  library minor version changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    /* CapsLock, Shift, and Control are special and hard-coded */
177
177
}
178
178
 
179
 
KeyCode modkeys_sym_to_code(KeySym sym)
 
179
KeyCode* modkeys_sym_to_code(KeySym sym)
180
180
{
181
 
    gint i, j;
 
181
    KeyCode *ret;
 
182
    gint i, j, n;
 
183
 
 
184
    ret = g_new(KeyCode, 1);
 
185
    n = 0;
 
186
    ret[n] = 0;
182
187
 
183
188
    /* go through each keycode and look for the keysym */
184
189
    for (i = min_keycode; i <= max_keycode; ++i)
185
190
        for (j = 0; j < keysyms_per_keycode; ++j)
186
 
            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j])
187
 
                return i;
188
 
    return 0;
 
191
            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j]) {
 
192
                ret = g_renew(KeyCode, ret, ++n);
 
193
                ret[n-1] = i;
 
194
                ret[n] = 0;
 
195
            }
 
196
    return ret;
189
197
}