oblitum / Interception

The Interception API aims to build a portable programming interface that allows one to intercept and control a range of input devices.
http://oblita.com/interception
1.33k stars 271 forks source link

Adding additional mappings to caps2esc / Creating a generalized template for caps2esc #41

Closed YenForYang closed 7 years ago

YenForYang commented 7 years ago

As you can tell from the title this issue is a fusion of a two questions/problems:

  1. If I wanted to do another "key mapping" and use it simultaneously with caps2esc, is it better to build the code in one cpp (create 1 executable) or two (create 2 executables)?

Actually, it's probably better to first know my specific case(s) since what I want may not be possible at all:

In my case, I want to basically do the same thing as caps2esc, but it only involves 1 key (i.e. no pair to swap like caps and esc):

  1. Would it be possible/better to create a general "template" [i.e. "organize" and "add" parts (if necessary) in caps2esc.cpp so that sections can more easily be "commented/uncommented" for different situations] so that we have a more general "tool" that can be used for a variety of "swaps" among modifier keys (like ctrl), contextual system command keys (like the Application/menu key or Escape key) and lock keys (like caps lock, or num lock, etc.)
oblitum commented 7 years ago

It should be certainly doable but I see no benefit in trying to generalize the caps2esc sample. Since it's a specific purpose sample, it better just be left as simple and dull as it's. As far as I can see, you can learn one thing or two from caps2esc and build the application you described.

oblitum commented 7 years ago

Regarding building mappings in one single application or two, it really your choice. I myself just use caps2esc on my machine, but if I'd use more mappings, I'd build them apart by purpose. Interception application precedences (which is explained in this very old tutorial) can also be of help when building distinct filters.