Git Product home page Git Product logo

Comments (8)

 avatar commented on May 18, 2024 1

Okay,
I am new to lua and awesomewm. I will give it a shot and let you know.

from modalawesome.

potamides avatar potamides commented on May 18, 2024

Hi,
for special keys you have to find out which string the callback function gets for a key. For <Tab> this is is 'Tab', so if you want to use <Tab> for a command your pattern should look like {'Tab'}. On a side note, you could also use {'T', 'a', 'b'}, but then you could also press <Shift>t, then a and then b for a match.

What do you mean with chords?

from modalawesome.

 avatar commented on May 18, 2024

Hi,
for special keys you have to find out which string the callback function gets for a key. For <Tab> this is is 'Tab', so if you want to use <Tab> for a command your pattern should look like {'Tab'}. On a side note, you could also use {'T', 'a', 'b'}, but then you could also press <Shift>t, then a and then b for a match.

Hi, thanks for replying quickly. This works.

What do you mean with chords?

Keys combinations like <C-a> and <Shift-Tab>.

from modalawesome.

potamides avatar potamides commented on May 18, 2024

Keys combinations like <C-a> and <Shift-Tab>.

Ah I see. Support for this is limited. You can map <Shift> in combinations with letters, e.g. <S-a>, because then the callback function is called with the uppercase letter 'A', so a pattern like {'A'} works, but that's it.
It would be possible however to support other modifiers, since the callback is also called with a table of pressed modifiers, which is currently ignored.

from modalawesome.

 avatar commented on May 18, 2024

It would be possible however to support other modifiers, since the callback is also called with a table of pressed modifiers, which is currently ignored.

And how can I do it?

from modalawesome.

potamides avatar potamides commented on May 18, 2024

Since as of now this functionality does not exist in modalawesome, you'd have to implement it first. I'd do it like this:

  1. add optional modifiers table to commands, which should contain required modifiers
  2. in keygrabber callback pass the modifiers table to parser function
  3. in parser function compare the modifier table of command with the one from the callback
  4. if there's a match execute corresponding handler

I have some time at the end of the month were I can take a look at this. Until then, pull requests are welcome :)

from modalawesome.

potamides avatar potamides commented on May 18, 2024

So I finally had some time to take a look at this. The feature is now functional, but I still want to think about it a little bit more, before I merge this. Feel free to check out the pull request in the mean time and tell me if it suits your needs :)

from modalawesome.

 avatar commented on May 18, 2024

Thanks a lot. I have been busy, I will check out the PR and let you know.

from modalawesome.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.