Keymando: Removing modifier keys when Sending keystrokes - keymando

When sending keystrokes using Keymando, is it possible to remove the currently held down modifiers?
An example:
map "<Cmd-d>" do
send("a")
end
This sends Cmd+a rather than a which is what I want. (This is a made up example, but illustrates the point.)
AutoHotkey (which is a key remapping and automation tool for Windows) releases any held-down modifier keys when sending keystrokes (and if modifier keys are required not to be released, one can specify a parameter for that as well).
How can I do the same in Keymando?
Even if there is no "smart" way to release held down modifiers, can I manually specify the modifiers I want released (Again, AutoHotkey allows one to send keystrokes like {Ctrl Up}. Is there something similar in Keymando)
Finally, are there any other, more powerful alternatives to Keymando for the Mac?

This issue is fixed in the latest 1.4 version.
http://keymando.com/download.html

Related

Can you search or filter Vim completions?

I am using Vim 8.0 with Python3 and myint/ClangComplete for C/C++ completions. SDL_<tab> suggests every function and type from SDL. Is there any way to limit suggestions to SDL_EventType types, functions returning SDL_Windows, etc.? BidiComplete seems like a good place to start, since SDL_<tab>EVENT would match SDL_WINDOWEVENT and SDL_FIRSTEVENT, but not SDL_FINGERDOWN, etc. Ideally I would like to be able to filter by any/all of the fields in the ClangComplete popup menu, since I might be interested in 'functions that take an SDL_Window* as an argument or return one'. The filtering/searching mechanism can just be regex over whole text of each line in the PUM.
The Vim completion engine YCM already implements support for this feature, and integrates well with clang. http://ycm-core.github.io/YouCompleteMe/#c-family-semantic-completion
As I mentioned in my comment, it appears as though you're asking for fuzzy completion, which is a feature that has already requested (see: github.com/Rip-Rip/clang_complete/issues/388). You may be able to use toobig's modification to get what you want.

how to process arrow, pageUp, pageDown keys in C or C++ on linux

How do I get the key codes so I can process arrow, pageUp, pageDown, etc, keys using simple C or C++?
I can get the regular keys, I do not know how to get these special keys.
Ncurses should be able to handle that. There is lots of tutorials out there
Linux based systems follow the UNIX tradition, in the sense that those keys are special and their values depend on the terminal settings.
This is so, because in the old days each UNIX system had a complete different type of keyboard. As such it is somehow complex to be able to write generic code to handle those special keys.
The best way is to make use of a terminal handling library, like curses or its successor ncurses.
Here you can get a nice introduction about keyboard usage,
http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/keys.html

MFC data exchange validation

We're using MFC data exchange to validate some data and we're having some problems. We're using the DDV_MinMaxFloat call to ensure that edit boxes in various parts of the application contain floating point numbers within a specified range. When using this validation if a value is entered out of range a dialog is automatically displayed to the user indicating that the value must lie within the range specified. This has been working correctly whilst running the application in debug however when building a release we are getting problems. The validation is still performed in release mode however the message box displayed to the user is blank.
I've tried the usual forcing a rebuild, deleting old resource files and deleting precompiled header files but this continues to happen in release mode. Has anyone come across this before? Are there any obvious things to look for?
I should also add that this application is over 10 years old, so obviously has been working correctly before. Somehow something has gone wrong in the last few weeks to cause this.
Those messages will come from MFC's resource strings. There might be some conflict with your own resources. Check to make sure your resources adhere to Microsoft's guidelines TN020: ID Naming and Numbering Conventions.
Pay particular attention to this bit:
MFC's internal framework implementations reserve two ranges: 0x7000
through 0x7FFF and 0xE000 through 0xEFFF.
Somehow something has gone wrong in the last few weeks to cause this.
Since your application worked fine a few weeks ago, it should be easy: check out the last working version from your revision control system and compare it with the current version. Or try to narrow it down to the first revision which does not work any more.
Check with Spy++ if there are controls on the message box that is displayed and if the text on them is blank, or if there's no controls on them at all. If the text is empty, you'll have to check the resources or the way the messagebox is called/created. Otherwise it may be something like resource being set incorrectly and the message assuming it can read its resource strings from ::AfxGetResourceHandle(). Note that this is a very easy error to make - it's a global handle that can be changed everywhere (including in dll's that you have no control over) so changes in remote parts of the code that at first sight seem unrelated may trigger it.

How does less take over to the console?

I want to take over the console like less does, to make a more interactive app. It seems like they have complete control over what gets drawn where. How can I do that?
It uses the ncurses library for handling the terminal.
Primarily, less and other full-screen terminal applications use the alternate screen mode; otherwise known as DEC mode 1049. terminfo stores the strings needed to enter/exit this mode in
enter_ca_mode=\E[?1049h
exit_ca_mode=\E[?1049l
Once you enter alternate screen mode, you get full control of the screen by the usual escape sequences, drawing to an entirely separate "buffer" on most terminals, that leaves the regular buffer (such as may contain the bash scrollback) unaffected. When you leave alternate screen mode again it restores the previous contents and cursor state.
Look up 'curses' in your system's documentation.
The ANSI escape codes might be a place to start. http://en.wikipedia.org/wiki/ANSI_escape_code

How to implement "record macro"-like functionality similar to Microsoft Excel?

How to implement "record macro" like that in Microsoft Excel? As far as I know, I can embed a scripting interpreter(eg. javascript) and make c++ objects visible to scripts, similar to the DOM in a web browser.
My question is how do you record user actions and then generate the corresponding javascript code? In Excel we can record a macro and it will generated the appropriate VBA code.
Does someone know how to implement this feature in C++ or in other languages?
PS: Can be any language/platform -- I just want an idea of how to do it.
One way to do it is have dual event handlers for each menu item / button click.
As the standard event handlers fire, your secondary macro-builder events fire.
As the macro event builders fire you record a list of actions performed
e.g.
ActiveDocument->Save.
ActiveDocument->SaveAs.
ActiveDocument->Print.
Find (AllDocument,"ThisText").SelectFirst
Edit.Cut
Find().SelectNext
You can then translate those actions into your desired scripting language.
Hope this helps.
Have a look at the Command Pattern. Each action in the program can be represented by a Command object. So when you're recording a macro, you both perform the command and store it in a list. When you want to play back the macro, you simply run through the list you created, performing every command again.
You don't necessarily even need to use distinct objects, though it will probably be easier in the long run. As an example, Emacs has keyboard macros that simply record every keystroke, then simulates those keystrokes when you play the macro back.