

This is weird, but I thought I could just add what xbindkeys -mk outputs to my ~/.xbindkeysrc: "xte 'keydown Alt_L' 'key Tab'" If I click other buttons, I get expected outputs like: state 0x0, button 2, same_screen YES I get no output when I click the G9 button I'm interested in. Let me know if that can affect things, although I'd need it to work in this case as well. Note: I am running this in a VM for testing purposes. If I run: xbindkeys -mkĪnd click the G9 button, I get this output: "(Scheme function)" The problem is that, as far as I can tell, this G9 button is not being read by the OS as a normal mouse button. The workflow I have in mind is: push G9 (shortcut for "push alt, push tab, realease tab") => select the window I want, release G9 (shortcut for "release alt"). So my idea was to emulate Alt+Tab with this button. AFAIK, there is no way to bring up a similar task list, which stays up until you click on something, without having to hold down any keys. I want a similar behavior under Kubuntu 15.04. So the workflow is: push and release the G9 mouse button, click the window I want. Note that this stays up even if you release both the Win and the Tab keys, it only goes away once you click on the Window you want to go to.
#Swify alttab macro windows
Under Windows 10, I have set one of its buttons (the small one labeled "G9" on top of the mouse) to show a task list, which can be brought up using the Win+Tab keys. This is okay, though, since nothing in my plan requires a dedicated section that part just makes the second half easier.Īs far as I know, the only way to get a symbol into the symbol table in Swift is via a local struct definition.Note: this is not a duplicate of either this or this, as I will make clear. I don't want it to be too ugly, though.Īs far as I know, Swift has no way to insert symbols into a given section - no equivalent of _attribute_((section)). Swift has no preprocessor, so spelling the magic as elegantly as MAGIC(someidentifier) is impossible. I can replicate the whole second half of that workflow just fine in Swift - starting with the getsectbynamefromheader() part. Through the magic of getsectbynamefromheader(), I can then load the symbol table for the magical section, scan through it, and find out (by demangling every symbol I find) that at some point in the user's code, he calls MAGIC(xyzzy).

What actually happens at compile time is that a static variable named xyzzy (modulo name-mangling) is created and allocated into the special magical section of my Mach-O binary, so that running nm -m foo.o to dump the symbols shows something a lot like this: 0000000000000098 (_TEXT,_eh_frame) non-external EH_frame0Ġ000000000000050 (_TEXT,_cstring) non-external L_.strĠ000000000000000 (_TEXT,_text) external _Z3foobĠ0000000000000b0 (_TEXT,_eh_frame) external _Z3foob.ehĠ000000000000040 (_TEXT,_text) non-external _ZZ3foobENK3$_0clEvĠ0000000000000d8 (_TEXT,_eh_frame) non-external _ZZ3foobENK3$_0clEv.ehĠ000000000000054 (_DATA,magical) non-external _ZZZ3foobENK3$_0clEvE5xyzzy In other words, the user writes something like this: #include "magic.h"Īnd thanks to the definition #define MAGIC(Name) \
#Swify alttab macro code
I have some existing C++ code that defines a macro that, when used in an expression anywhere in the code, will insert an entry into a table in the binary at compile time. I want to do in Swift something like the same thing I'm currently doing in Objective-C/C++, so I'll start by describing that. This is kind of a weird and un-Swift-thonic question, so bear with me.
