All:
So, after reviewing the situation, and the need for the FakeKeypress, here’s the situation, in glorious detail – if anyone can help, just tell me who to write the check to afterwards:
I have an application that I MUST USE that is expecting XEvents from the FVWM. The XEvents are then being put into a proprietary object, and passed off to another machine via UDP - I therefore must use this XEvent receiver/UDP server. This XEvent receiver actually has 2 instances active at all times (to allow for ‘different states of functionality’ – I didn’t write this piece of crap – I would have used a memento to tell the darn thing what state it was in… but thats neither here nor there), one represented by a symbolic link, and the other is just the app in it’s basic state.
I must therefore pass keypresses, change of focus commands, etc. to this XEvent receiver via the FVWM (because it is an app that is dependent on the FVWM)
I have succeeded in being able to pass Change of focus commands successfully to this Xevent Receiver/UDP server. However, The key press and key release xevents are being used by the FVWM to call functions in the .fvw2rc and so I am trying to pass ‘copies’ of these keypresses to the waiting XEvent reveiver using FakeKeypress.
As I have noted in previous posts, I have a keyboard with special keys. One of these special keys has a keycode 205. In an xmodmap augmenting file, I have mapped that keycode to F23.
I then have bound this ‘F23’ keyvalue /keycode to a Function:
Key F23 A A FuncFocusAppSwitch
Now, the functionality that I desire out of this keypress (as I have pointed out earlier, but am apparently just too stupid to make work) is to have two applications ‘toggle’ one in front of each other, regardless of which desk/application is currently in focus. If F23 is pressed, and I am currently on Desk 4, or Desk 7, or Desk332, working on something else,I need the WM to:
[list]
- GoToDesk 0 0 (where I have placed this Xevent receiver/UDP server)
- place the focus onto the application entitled ‘simbProxy_AddApps’(by default, app proxyApps is in focus on Desk 0 at startup) which resides on Desk 0
-pass a keypress event and a key release event to simbProxy_AddApps with value F23
[/list:u]
Then, if F23 is pressed again or the focus, in anyway, is removed from simbProxy_AddApps, I need FVWM to do the following:
[list]
-Switch the Focus back to the application entitled proxyApps
-Send a key press, key release event to proxyApps with value F23
[/list:u]
that’s mostly what I’ve been trying to write for the last week, and I can’t get it to work. I can get the change of focus to work just fine, but I can only get a keypress/keyrelease events sent every other time I press my F23 button. The first time I press F23, a Key press, a key release and a Focus change XEvent are received by the XEvent receiver. The second time I press F23, only the focus Change event is received. The third time, the key press/key release are received, as well as the change focus event.
I am stumped, entirely. Below is the code that I have been trying to get to work, in it’s latest incarnation.
If anyone has any idea, please let me know, and I’ll donate 100 US dollars to the fvwm.org site, or whatever - I just gotta get this to work.
Key F23 A A FuncFocusAppSwitch
DestroyFunc FuncFocusAppSwitch
AddToFunc FuncFocusAppSwitch
+ I FuncSwitch "proxyApps" "simbProxy_AddApps"
AddToFunc FuncSwitch
+ I Next ($$0, !Focused, CirculateHit) Function MakeVisible
+ I TestRc (Match) Break
+ I Next ($$1, !Focused, CirculateHit) Function MakeVisible
# Helper function
DestroyFunc MakeVisible
AddToFunc MakeVisible
+ I Iconify off
+ I Raise
+ I Focus
+ I WindowId $[w.id] FakeKeypress press F23 release F23
# + I FakeKeypress depth 2 press F23 release F23
+ I Break
Any ideas or comments would be greatly, greatly appreciated