Hi,
I’m trying to make a script to enter command (like gmrun or the KDE ‘Alt+F2’ function).
Here’s the script :
WindowTitle {FvwmCmdRun}
WindowSize 180 24
#WindowPosition 0 0
Colorset 8
Init
Begin
WarpPointer 2
Key Return A 2 1
Key Escape A 1 1
#Key Escape A 2 1
End
PeriodicTasks
Begin
End
Widget 1
Property
Position 0 0
Size 30 20
Type ItemDraw
Title {Run: }
Flags NoFocus NoReliefString
Main
Case message of
1 :
Begin
Quit
End
End
Widget 2
Property
Position 30 0
Size 150 18
Type TextField
Title {}
Flags NoReliefString
Main
Case message of
1 :
Begin
Set $cmd=(GetTitle 2)
Do {Exec exec } $cmd
Quit
End
End
I use this style definition :
Style FvwmCmdRun NoTitle, StaysOnTop, WindowListSkip, CenterPlacement, NoHandles, GrabFocus
Basically, this work, but I’ve got one problem : the keyboard focus.
The WarpPointer function is strange.
When I launch this script, the mouse cursor warp to the top left corner of the screen, as if the script window was there (but with CenterPlacement, it’s centered on the screen…).
How can I handle the warping correctly ?
(All this because you must have mouse cursor in TextField in order to enter text…)
TIA