Hi.
When i use Alt + Tab to switch programs , the mouse pointer alway moves to the left top corner( the title-bar button ).My wireless mouse need click to wake up. I rarely use mouse.After using keyboard for a while , if have to use mouse, click or rolling the mouse wheel always pop up a menu ,and , sometimes i close the program mistakenly .
I run conky in a small window to show my computer’s statics. i want to press some key to show the window, release hide the window.I do not know how to do that.
Thank you for the extremely fast , flexible program !
This is because Alt-Tab invokes the WindowListFunc which invokes a command “WarpToWindow 5p 5p” which places the cursor at the top-left corner of the window. What you can do to mitigate that is to, say, place it in the centre.
DestroyFunc WindowListFunc
AddToFunc WindowListFunc
+ I Iconify off
+ I FlipFocus
+ I Raise
+ I WarpToWindow 50p 50p
So you want some toggling action?
DestroyFunc ToggleConky
AddToFunc ToggleConky
+ I None (conky, CirculateHit) Exec exec conky
+ I Next (conky, CirculateHit) Close
Key SomeKey A MC ToggleConky
Where “SomeKey” is the key you want. The above binding also ensures you press Alt and Control together with SomeKey to activate it – this is a useful decision to make in situations where you want the binding to apply anywhere.
I have learned two things from your code
1.using shell environment variable to store window states
2.place the window outside the screen to hide it(?).
Conky is a strange program . The title-bar keeps gray even i click it.I can move it,maximize it . “+ I All(conky) SomeCommand”, SomeCommand never get called.
My FVWM version is 2.5. The conky window properties are
Focus Policy : No Input
-Input Field: False
-WM_TAKE_FOCUS: Absent
Except unfortunately it’s not a good lesson to learn. At no point in that function is the environment variable cleared - it shouldn’t even be used in the first place. You could just set a State on the window, although what would be easier is if you used this:
DestroyFunc SomeFunc
AddToFunc SomeFunc
+ I Next (some_window, !CurrentPage, !Visible) AnimatedMove m+0 m+0
+ I TestRc (Match) Next (some_window) Raise
+ I TestRc (Match) Break
+ I TestRc (NoMatch) Next (some_window) AnimatedMove -5000 -5000
That way, there’s no need to hold any values, or remember to unset any environment variables, etc.
It would not work if that variable was cleared in that function. In fact, that variable NEEDS a value from the start of the session. Otherwise, you don’t have the actual stated of the window, and the rest of the code is useless.
I like your alternative idea, though, and will play with it. It is more efficient (as usual), so, if there is no problem with it, I might change my kuake to use this. Thanks.
Do not want to create one more topic with the same name, so i will write here.
I need to move mouse pointer to the some(static) position on the screen (the screen can be with windows or without).
For example i have 1280x1024 resolution of screen and i need function that will move pointer to position 1000x800 pixels.
In documentation i only find “CursorMove” function, but it moves pointer from current position to some % or pixels up or down, and is there some function which will just set pointer to position i need?
Or can i use CursorMove for this, but with some math calculations of pixels to which i need to move (current position - needed position)?
When you specify a coordinate such as “fooXbar”, you’re really trying to translate those to co-ordinates anyway, so CursorMove actually helps you here. So work out the static location in pixel terms.