You are not logged in.

#26 2013-09-23 23:29:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

Re: Iocane: poison the rodent (simulate X11 mouse events from keyboard)

I have the same xmodmaps, and I cannot replicate that problem here.

How do you execute iocane?  Do you use it interactively, or do you execute a script or command-line command movement?

You say this happened recently, does that mean you just noticed it, or did it used to work as intended but recently changed?  If the latter, how recent?  The code hasn't changed in quite a long time, so if it was recent, it'd be due to the interaction with whatever was updated at the time of the change in behavior.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#27 2013-09-23 23:47:13

portix
Member
Registered: 2009-01-13
Posts: 757

Re: Iocane: poison the rodent (simulate X11 mouse events from keyboard)

kaari wrote:

Hi Trilby. I have my Caps Lock key remapped to Escape in ~/.xinitrc:

xmodmap -e "clear lock"            #disable caps_lock
xmodmap -e "keycode 0x42 = Escape" #caps_lock is now escape

Recently, I noticed that executing iocane reverts Caps Lock to its old behavior. Could you have a look at what is causing this?

Have you tried to remap caps with setxkbmap? For me setxkbmap is more reliable than xmodmap. To map caps_lock to escape you can simply execute

setxkbmap -option caps:escape

Offline

#28 2013-09-24 00:08:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

Re: Iocane: poison the rodent (simulate X11 mouse events from keyboard)

Activity in this thread made me look back at the code and I realized the package is due for an update.

It seems I was making some substantial changes on the code up on github, but unlike most of my packages this is not a -git PKGBUILD, so the aur package is still at the last "stable" version.

For the purposes of the present issue, I'm still testing with the current stable version and cannot (yet) replicate this problem.  But I'll also update the aur package soon which has substantial design and code changes - so further troubleshooting may be best targeted at that after I post it to the aur.

EDIT: I just packaged the updated code as ver 0.4 now in the AUR.  Note that the existing man page is no longer completely reliable, but my general versioning scheme is that anything less than 1.0 is not considered complete usually due to missing documentation.  The bump to this thread is good reason for me to finally finish the man page and get a proper 1.0 release of this ready.  Expect that to come within a week.  The main difference in functionality is that the interactive mode is no longer the default.  Along with this, I've done away with many functionally overlaping "modes" like script mode.  0.4 runs by default in a script-like mode that reads from stdin.  Use `iocane -i` for the interactive (previously default) mode.

Last edited by Trilby (2013-09-24 00:16:22)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#29 2013-09-24 14:22:13

kaari
Member
Registered: 2011-08-12
Posts: 22

Re: Iocane: poison the rodent (simulate X11 mouse events from keyboard)

@portix: I applied your suggestion. It is much more elegant.

@Trilby: I execute iocane in interactive mode with Mod_I in dwm. By "recently", I mean that I only remapped caps to escape a few weeks ago. I just updated iocane to the latest version in AUR and my problem is resolved, though iocane doesn't respond to the remapped-caps_lock-now-escape; I have to hit the genuine escape key to close it.

Last edited by kaari (2013-09-24 14:23:43)

Offline

#30 2013-09-26 15:45:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

Re: Iocane: poison the rodent (simulate X11 mouse events from keyboard)

Kaari,

I am seeing the same issue in interactive mode.  I tried portix's suggestion which didn't change this problem.

For a bit I thought the problem came from calculating a keycode from the keysym string in the config file: if two keys are mapped to "Escape" the X11 function still only can give one key code.  I worked around this by doing the reverse logic: I scanned through every keycode available on the display and tried matching the keysym against the string in the keycode.  This should allow mulitple keys to be bound to the "Escape" key string.  This had no effect, though, so I removed that code again.

I tried implementing localization and initializing an X input context (XIC), but this had no effect.

I have another small tool which does register the CapsLock mapped to escape as an actual escape key.  The only remaining difference is that the other tool has it's own window, iocane catches events on the root window.

I'll continue to look into this, but I don't see a solution to be likely as iocane will never have it's own input window.


On another note, I've updated the man page, and cleaned up the recent changes.  Iocane can even run scripts with an iocane shebang:

#!/usr/bin/iocane
move 0 0
sleep 1 0
button 1
move 40 40
cursor 65
...

Last edited by Trilby (2013-09-26 15:45:52)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB