topic title: Mouse Config
Posts: 1,081
OU812
Joined: 29 Sep 2007
#1
Hello. After having some success with rewriting the screenshot app, I decided to try and write a mouse config app was well. I patterned it after the rox mouse config utility that you see here:


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://roscidus.com/desktop/Mouse"
linktext was:"http://roscidus.com/desktop/Mouse"
====================================
" onclick="window.open(this.href);return false

Here's my version:


I'm sure that I can code most of it, but there are some issues:
1. I would rather have sliders for the acceleration options, but I don't know how.
2. I don't know the range of values for threshold or acceleration. And I don't know how values outside of the range are handled.
3. I don't know how to change the pixel size of the cursor. I could swear I found some pages before, but not today; perhaps I'm just using the wrong words in google.
4. I'd like to use the up/down button for adjusting the mouse pixel size, but I don't know how.

Let me know what you think. Any help is appreciated.

BTW To have the mouse acceleration changes be"permanent", an entry needs to made in your ~/.xinitrc file. Haven't tried it yet as I've only created the mouse config window. The only working part is the theme button. Everything else is non-functional a the moment.

Thanks.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#2
I started coding the actions and realized that there were some problems with the acceleration options. Since there were given default values, then every time a user pressed OK, the values would be used even if the user was simply, for example, changing themes. So I had to find a way to disable entry until a user purposefully wanted to change the values. Here's my update:


So I'm still coding the options, but I don't know how to change the pixel size. Also, I haven't edited ~/.xinitrc. I want to make sure things are working before I edit the file.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#3
I just realized that the same problem posted previously would apply the pixel size option as well. So I used the same solution: added a checkbox. I also improved the layout a bit (the"restore defaults" checkbox was moved inside the"mouse acceleration" frame). Rather than post a new screenshot, I will code everything except the pixel size option. When the coding is that complete, I will return and post a screenshot.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#4
I've"finished" coding; i.e. everything is finished except for the pixel size option, which I still don't know how to do. Maybe puppy or dsl has a script I can take a look at.

I've also realized that I need to create check boxes so a user has the option to make the changes permanent; by permanent I mean adding the adding the code to their wm's startup file. This should be easy enough to do for one change, but if the user keeps making changes or wants to revert to default settings, things may get too difficult for me. We'll see.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#5
As an experiment, I added a line of code to the button layout option. This added the left-hand button layout to ~/.icewm/startup successfully. When I logged out/in to icewm, I had a left-hand button layout. Removing the code or updating it for the user may take some time to figure out.

So now I have a dilemma: Do I find a way to allow for the editing of the startup files each time a user changes their mind? Or do I edit the files for them once and then leave it up to them to edit the files afterwards?

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#6
I've been getting some help with some perl scripts that could solve the problem of adding and editing mouse configuration options in the various startup files. I will need some time to get it coded though. Perhaps by the end of the weekend.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#7
I've been able to code the program so that it can make any of the changes on a temporary basis (with the exception of the theme option, that is).

What's been difficult, and may be a show-stopper, is making the changes permanent. I can save the options to a config file such as ~/.icewm/startup, but changing them after that is a problem. I am getting help at mepislovers, but it's becoming clear that I'm out of my league on this one.

So we can still include the app"as is" in a future release; after all, the current mouse config tools behave in the same manner: the theme changer works and makes permanent changes while the mouse config app (button layout only) works but the changes are lost during the next"session." So in the final analysis, we've gained some options but not any functionality.

What are your thoughts on this one? Thanks.

john
anticapitalista
Site Admin
Joined: 11 Sep 2007
#8
We'll use it.
Send me a copy and I'll see if I can find a way to make the changes permanent
Posts: 1,081
OU812
Joined: 29 Sep 2007
#9
That might take a day or two to clean it up a bit. I'm also not at my box right now. I also have some other ideas up my sleeve as I feel a bit rejuvenated.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#10
Hello. Thanks to some help from the mepislovers forum, I got the app mostly complete. To get it working, I had to edit ~/.xinitrc will some initial config options. When you run the mouse script, commands are issued so that you get the changes immediately. The changes also get written to .xinitrc so you'll have the changes available at login. I have also allowed for a"restore defaults" options.

To do:
Allow users to change the cursor size.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#11
The mouse config app is now nearly complete. After several rounds of google searching and looking at the code of similar apps, I finally find a simple and elegant solution: Just add something like this to ~/.Xdefaults

Code: Select all

Xcursor.size: 32
Then log out/in. Simple as that. And comment it out to return to the"default" cursor size (actually xcursor will decide this value if the line is commented out). Now I need to clean up the code - both in terms of documentation and in terms of trying to reuse parts of it so it's not spread out over so many individual scripts. Also, I need to find the basic parameters of mouse acceleration and threshold, as well as some common cursor sizes so I can display them in the window. This will give users some guidance on setting new values.

Any help with finding the"basic" values mentioned above would be appreciated.

Here's a screenshot:


john

(So after cleaning up the screenshot and mouse apps, I want to start working on a keyboard app.)
Posts: 1,228
secipolla
Joined: 15 Jun 2008
#12
Acceleration 2
Threshold 4

(my current settings)

Puppy options for acceleration:
1.0 1.2 1.4 1.6 1.8 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0
Puppy option for threshold:
1 2 3......16
Posts: 1,081
OU812
Joined: 29 Sep 2007
#13
Thanks.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#14
If you would like to test the app, send me a pm with your email address and I'll send it to you. You'll need to:

1. Make all of the scripts executable
2. Copy all scripts to /usr/local/bin
3. Edit your ~/.Xdefaults using the included example
4. Edit your ~/.xinitrc using the included example

Thanks.

john
Posts: 1,081
OU812
Joined: 29 Sep 2007
#15
Just thought of something: I need to include a notification window that tells a user that the cursor theme has been changed. Also, the config window closes when the new theme is chosen; should it stay open instead? Please let me know.

BTW - these issues do not break the application.

john