[UNSOLVABLE] FvwmScript - How to bind different mouse buttons?

You guessed it, FvwmScript questions go here! Also post your FvwmScripts here for others to enjoy.
User avatar
Decadentgray
Kitten
Kitten
Posts: 20
Joined: Fri Sep 06, 2013 4:38 am
Location: Nuremberg / Germany

[UNSOLVABLE] FvwmScript - How to bind different mouse buttons?

Postby Decadentgray » Fri Feb 17, 2017 2:09 am

Hello everyone ;)

I try to have a script showing me the time, laid over the background, conky style.
I'd wish to use my desktop mouse binding over the area where the clock shows as well, so I of course need to replicate them there, but somehow it doesn't work.

My first approach was to create a FvwmButton window, put the script inside it, and bind the buttons. Here is the code:

Code: Select all

*FvwmDeskButtons: (1x1, Frame 0, ActiveColorset 9, Swallow FvwmDesktopClock `FvwmScript $[FVWM_USERDIR]/scripts/DesktopClock 14`, Action (Mouse 1) Menu MenuFvwmRoot Nop, Action (Mouse 2) Menu MenuFvwmRoot Nop, Action (Mouse 3) Menu MenuFvwmRoot Nop, Action (Mouse 6) FuncPrevPage, Action (Mouse 7) FuncNextPage)


The Buttons do load, and the clock is shown, but the defined actions don't fire, as if I had bound them with "ActionIgnoresClientWindow", which I obviously haven't.

My next try would be to make the window borderless and lower it to the lowest layer, and bind the mouse buttons (1, 2 and 3 for the rootmenu, 6 and 7 for desktop switching) directly to the script. I know of

Code: Select all

 Case message of
  SingleClic :


But this binds only one mouse button. Would there be either a way to make the FvwmButtons work out, or to bind buttons 2 to 7 in the script?
Here's the script for comparison (nothing fancy, just one text widget showing the time :P ):

Code: Select all

WindowTitle {FvwmDesktopClock}
WindowSize  480 210
Font   "Shadow=1 C:xft:GeosansLight:style=Regular:size=120"

Init
 Begin
  Set $MainColorset=(GetScriptArgument 1)
  If $MainColorset <> {} Then
  Begin
   ChangeColorset 0 $MainColorset
   ChangeColorset 1 $MainColorset
  End
  Set $tmp = (GetOutput {exec date "+%k:%M"} 1 -1)
  ChangeTitle 1 $tmp
End

PeriodicTasks
 Begin
  If (RemainderOfDiv (GetTime) 30)==0 Then
  Begin
    Set $tmp = (GetOutput {exec date "+%k:%M"} 1 -1)
    ChangeTitle  1 $tmp
  End
End

Widget 1
Property
 Position 0 0
 Size 480 210
 Type ItemDraw
 Flags NoReliefString
 Title {}
Main
 Case message of
  SingleClic :
  Begin
  End
End


Of course I could write something in python with qt or gtk, but I would really hate to waste resources for this ;P
Any help is really appreciated :D
Last edited by Decadentgray on Sun Feb 19, 2017 7:00 pm, edited 1 time in total.
Learning lines in the rain - Special effects by lunatic and drinks - Freeze frame, screen kiss - Hot heads, lights and power - It's patently obvious --- She's in parties - It's in the can - she's in parties - It's in the can!!

somiaj
Administrator
Administrator
Posts: 39
Joined: Mon Nov 08, 2004 9:54 pm
Location: Idaho (USA)
Contact:

Re: FvwmScript - How to bind different mouse buttons?

Postby somiaj » Fri Feb 17, 2017 7:03 am

I'm surprised the actions defined in FvwmButtons didn't work.

In the manpage I noticed this flag for Swallow

NoFvwmModule / FvwmModule

And by default it will treat FvwmScript as an FvwmModule and I wonder if this is changing things.

Maybe add the NoFvwmModule flag to your Swallow line and see if that has any affect.
-jaimos

User avatar
Decadentgray
Kitten
Kitten
Posts: 20
Joined: Fri Sep 06, 2013 4:38 am
Location: Nuremberg / Germany

Re: FvwmScript - How to bind different mouse buttons?

Postby Decadentgray » Fri Feb 17, 2017 3:23 pm

Thanks for your fast reply ^^

Code: Select all

I'm surprised the actions defined in FvwmButtons didn't work.

Yeah, me too ;)

NoFvwmModule doesn't do the trick, after that I tried to circumvent this possible Issue by renaming the generated Window to 'DanielDeskClock', but to no avail...
Seems like I need to find another solution ;)
Learning lines in the rain - Special effects by lunatic and drinks - Freeze frame, screen kiss - Hot heads, lights and power - It's patently obvious --- She's in parties - It's in the can - she's in parties - It's in the can!!


Return to “FvwmScript”

Who is online

Users browsing this forum: No registered users and 1 guest