And maybe also:

mod = {}
mod.none = {}
mod.alt = { "Mod1" }
mod.win = { "Mod4" }
mod.shift = { "Shift" }
mod.ctrl = { "Control" }
mod.alt_shift = { mod.alt[1], mod.shift[1] }
mod.win_ctrl = { mod.win[1], mod.ctrl[1] }
mod.win_alt = { mod.win[1], mod.alt[1] }
mod.win_shift = { mod.win[1], mod.shift[1] }
mod.win_ctrl_alt = { mod.win[1], mod.ctrl[1] }
mod.win_ctrl_shift = { mod.win[1], mod.ctrl[1] }

Inspired by GGLucas' config, but swapped bind/functon table pairs, so I can
have multiple keys for one command...

On Wed, Oct 8, 2008 at 5:38 PM, dante4d <[EMAIL PROTECTED]> wrote:

> Hey, it works :P. But still with a little downside. But first, what I've
> done:
>
> bindings.spawns = {
>     [{ mod.win, 'p' }] = 'pidgin',
>     [{ mod.win, 'Return' }] = 'urxvt',
>     [{ mod.win_ctrl, 'x' }] = 'xkill',
>     [{ mod.alt, 'Shift_L' }] = 'urxvt',
>     [{ mod.alt_shift, 'd' }] = 'urxvt'
> }
> for bind, spawn in pairs(bindings.spawns) do
>     keybinding(bind[1], bind[2], function () awful.util.spawn(spawn)
> end):add()
> end
>
> Should be clear. When I press alt+shift, urxvt opens. When I hold it and
> press d, another urxvt opens. So it's nearly prefect, BUT - when I press
> alt+shift+d, two urxvt's open. To fix it, in theory, I know I need to set
> flag when alt+shift goes down. If any other key goes down, I unset that
> flag. When alt+shift goes up, I check that flag and when it's true, I
> trigger alt+shift action. That's about how it possibly works. But how to
> implement it correctly and cleanly?
>
> But what's good is that Konstantin's solution works, and I don't need to
> unset modkeys with xmodmap (which would be over-ugly)...
>
> Thanks
> David
>
> On Wed, Oct 8, 2008 at 11:37 AM, Konstantin Stepanov <[EMAIL PROTECTED]>wrote:
>
>> Have you tried keysyms?
>> Something like
>> keybinding( {}, "Control_L" ...)
>> keybinding( {}, "Alt_R" ...)
>> etc.
>>
>> xev is your friend on this way.
>>
>> 08.10.08, 13:00, "dante4d" <[EMAIL PROTECTED]>:
>>
>> Hi,
>>
>> ok, so I'll have to find some other way around. That's bad for me...
>>
>> Thanks
>> David
>>
>> On Wed, Oct 8, 2008 at 8:50 AM, Julien Danjou <[EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>> At 1223407164 time_t, dante4d wrote:
>>> > can I create key binding using only Control key, or Alt+Shift (simulate
>>> X
>>> > grp_switch keys, so I can make my own logic for switching)?
>>> > So far I haven't come up with any solution.
>>>
>>> No you can't use only modkeys as binding. That's rather a X limitation
>>> than an awesome one.
>>>
>>> Cheers,
>>> --
>>> Julien Danjou
>>> // ᐰ <[EMAIL PROTECTED]>   http://julien.danjou.info
>>> // 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
>>>
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG v1.4.9 (GNU/Linux)
>>>
>>> iEYEARECAAYFAkjsWDgACgkQpGK1HsL+5c3yggCfcxl2stNv3Vk0n0igqgvFwR8E
>>> cOwAoLhh6DPgGr5itbbedpALZ4weXuUU
>>> =4rZk
>>> -----END PGP SIGNATURE-----
>>>
>>>
>

Reply via email to