create new tag
, view all tags
See KeyboardMacrosInLinux -- not much progress on that front so far -- maybe I'll find something good in kde 3 when Mandrake 9.0 comes out, but in the meantime I've decided to go digging into writing my own utility.

Xnee is the latest thing I've found (I'll start a page, soon) that might do what I want. Looks promising, except that I've downloaded it and started trying it out:

  • the documentation doesn't match the version (1.0.7 IIRC) I tried out in several respects (no playback speed setting, no keyboard / mouse specifier (??), no macros (??))
  • it seems very (too) slow — I wrote to the mailing list, no response so far, I wonder if it's due (all or partly) to the storage mechanism (a separate file vs. an in memory "database" (structure)), or maybe the sync mechanism (which I didn't intentionally try so far) is part of the problem (IIUC, I tried running without sync)

The Xnee team wishes to correct a few things:

  • Xnee replay at a use defined speed
  • Xnee can replay a recorded session
  • Xnee can't start when a key+modifer is pressed. You can use tools such as xkeymouse to trigger xnee to start when a key+modifer is pressed. This combination gives us a macro, doesn't it?
  • Xnee is NOT slow. Xnee usually replays at the same speed as when recorded.
  • If recording many data used for synchronisation Xnee can be slow. There are two simple solutions to this; a) record less sync data b) don't use synchronisation for simple replays

Thanks for the corrections, and sorry about not updating this page sooner! I should note that Henrik Sandklef (who added the comments above) had responded to me shortly after I sent my first query. I ran into some problems (hard disk crash, without backup frown on my mail server) and got distracted. The information that Xnee plays back at the same speed as recorded is probably key (along with the suggestion to minimize synchronization data), IIRC, there is a way to adjust the playback speed (at least in some versions of Xnee). Also, I'll read up on xkeymouse. -- rhk - 15 Jan 2004

See AboutThesePages.

See also:

Another page makes reference to Xim (X Input Method) which may be the solution I need or a tool to help make it -- I would like to know which -- can I use Xim (as a user) out of the box, or must I write some code, including possibly an xim server?



Looking at this again today, it doesn't look like too bad a strategy (this after learning about xvkbd and other dead ends) and thinking that I'm going to have to program a change (or patch) to the X server myself. So, I'll probably keep this page as the strategy page, but start sort of a diary page to keep some notes of how things go and the progress I make. (Like the email server stuff, at some point I should refactor the stuff to make a more coherent understandable story, but I haven't done it yet for the mail server stuff. wink Maybe someday I write an article on it, get paid for it, and use that as the impetus to clean that stuff up (either the mail server, this, or both). I'll call the diary page XServerModificationProject (to start -- if it ends up being a lot of pages I'll create a prefix (as I've done for other things, including, for example, the AbiWordFAQ pages.

I think I'd like to try to create the utility at the level of X (instead of below that level) for a variety of reasons:

  • That would satisfy almost all my needs -- I rarely work at a virtual console because I have trouble seeing the white on black text without getting a headache -- I do almost all my command line work at an xterm (konsole).
  • X and below (i.e., non X) would probably require two different strategies (utilities) anyway.
  • xmodkey looks somewhat promising -- even more promisisng is the stuff discussed in the dumpkeymap utility, which appears to be part of X at least under Apple / Next (and maybe it exists or is easy to do under plain X).

The approach discussed under dumpkeymap is one where there is a special identifier (meta value), KEY_SEQUENCE, which indicates that an entry in the Character::set (where is that set up??) is a sequence of keys instead of a single key: "A sequence is a series of modifiers and characters which are automatically generated when the associated key is depressed."

Update: I don't think it is part of X -- I think it is part of the Next software -- I plan to write to the author and clarify -- even if it is not part of X, it may be useful to know that Next has/had this capability in convincing a "real" X developer to make a modification.

So I'm trying to read, ask questions, and basically learn more about that, and xlib, because I have the impression that xlib is the thing that I'd have to change. (I am assuming that I have to change xlib as opposed to writing a program based on xlib, but I'm not absolutely sure.)

I'm having trouble finding the source code for xlib -- I've looked in several places on the Internet, and I've looked at my Mandrake 8.2 and 7.2 installs, using rpm. (Just as an example of the trouble, rpm -q --whatprovides xlib returns essentially "nothing provides xlib" -- I guess I can try various capitalizations.)

I started digging into things like lesstif and motif, and realized that gtk, qt, and wxwindows (among others) are alternatives to lesstif and motif, and a reason not to write a utility at that level -- I'd need five (or more) -- if I write it at the level of X, hopefully I need only one.

I've collected some links to resources already, so I'm going to record some of those.

UPDATE 23 Sept 2002: I've found the source code and some "official" documentation for the X server (see X Window), and have an idea on how to approach this -- some (or all) of what I wrote above needs correction or deletion based on my current knowledge.

I think most of the changes will need to be made in the X server (vs. xlib or any clients). Here's a tentative approach (with some definite misunderstandings based on lack of knowledge so far -- next I'll probably try to dig into the X server source code):


  • Create a file containing a list of keyboard shortcuts (form to be discussed below) and the desired "expanded string" (i.e., the keystrokes you want to be entered when you type the keyboard shortcut). Whether these are stored as ASCII strings, "strings" of keysyms or keycodes or whatever remains to be seen, depending on some things like when a key(press|release) event is created and what it contains.

  • <later> Create a fancy interface (GUI) to help populate that file.

Approach: <Hmm, I wrote some stuff about this on a file that's not at hand right now (I'm away from my home base -- I'll wait till I get back there and then start this section by copy and paste from that file -- well, I've got a few minutes, maybe I'll start.):

  • Add code to "watch" incoming keystrokes (in the server, possibly before they've been formed into events) for special keystrokes (keycodes, keysyms) that indicate this character is an indicator of a *KEYBOARD_SEQUENCE". (Or really, I think I prefer to try to allow for double or longer special keystroke sequences, e.g. <ctrl> <alt> k q, so I need to think about how to do that.)

  • When the X server recognizes such a KEYBOARD_SEQUENCE indicator, it should look up the "translation" in the file listed above, then remove events for the original special keystroke(s) (if they've been created) and stuff the event queue with events for the "translation" string (with keycodes or keysyms, as appropriate for the current design of X). It needs a way to determine whether it should generate both keypress and keyrelease events, or just keypress events (unless this issue is handled some other way in X).

Digression on multiple vs. single keystrokes:

  • I'd really like to have the ability to store a lot of keyboard macros -- possibly numbered up to 999 or "alphanumeric'ed" (a-z0-9) from aa to 99 (??). I might like to mix mnemonic type macros (<ctrl> <alt> sig) with non-mnemonic. <have to go>


See ResourceRecommendations. Feel free to add additional resources to these lists, but please follow the guidelines on ResourceRecommendations including ResourceRecommendations#Guidelines_for_Rating_Resources.

See also:


  • (rhk) [[][]] --

Recommended for Specific Needs

  • (rhk) [[][]] --

Recommended by Others

  • (rhk) [[][]] --

No Recommendation

  • (rhk) [[][]] --

Not Recommended

  • (rhk) [[][]] --


  • (rhk) RandyKramer - 19 Sep 2002
  • <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>

Page Ratings

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2004-01-15 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look