Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 21 Aug 2014, 18:06
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
OneSwitch pet - control a PC using a single switch
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 5 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Thu 04 Jul 2013, 05:12    Post subject:  

Ok, it works as follows:
If Radar or NavBar is already running and a user tries to launch the other one (no matter if from GUI or directly), a pop-up window will appear (see screenshot) with 'Swap' button.

Thanks for testing &
Greetings!
OneSwitch-1.1.4.pet
Description 
pet

 Download 
Filename  OneSwitch-1.1.4.pet 
Filesize  93.1 KB 
Downloaded  196 Time(s) 
Screenshot.jpg
 Description   
 Filesize   72.22 KB
 Viewed   406 Time(s)

Screenshot.jpg


_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Sat 06 Jul 2013, 03:57    Post subject:  

Excellent, thanks. The swap works well in both directions.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Tue 16 Jul 2013, 15:40    Post subject:  

This thread now split off from the original early stage programming discussions and relabelled in order to make this topic easier for people to find.
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2312
Location: Heart of Texas

PostPosted: Tue 16 Jul 2013, 18:20    Post subject:  

off-topic is not correct way of splinting off thread. This hides it from non-registered members. Confused
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Tue 16 Jul 2013, 20:15    Post subject:  

Ahhh, thanks Ted Dog - I didnt think of that. I will ask Flash to relocate it. What do you think would be the best place for this to be moved to?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11017
Location: Arizona USA

PostPosted: Thu 18 Jul 2013, 10:38    Post subject:  

Embarassed Oops, I didn't mean to put it in Off-topic when I split it. I guess I didn't check afterward.
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2312
Location: Heart of Texas

PostPosted: Tue 30 Jul 2013, 23:10    Post subject:  

Now that you read this far. Here are two threads that follow the effort one is the hardware mods ideas and actions, the other is the software


Hardware Thread
http://www.murga-linux.com/puppy/viewtopic.php?t=87103

Software Thread
http://www.murga-linux.com/puppy/viewtopic.php?t=85466

Enjoy!
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Fri 02 Aug 2013, 14:51    Post subject:  

I am proposing a slight change to the radar choices and wondered what other users thought...

I find I do not use the "cycle" function as it seems just as easy to pick the desired window up off the taskbar - but what I really miss is the ability to drag an entire window using Alt/Leftclick. This seems so much easier than trying to grab a window by it's title bar and then selecting drag - I often find the title bar is offscreen or too far away etc etc, whereas alt/leftclick allows you to grab the window anywhere that it is visible.

So what I have trialled is a mod to radar, eliminating the cycle function and replacing it with "DragWindow". (we still need to retain "Drag" as it acts as a "lasso" function within the window contents, whereas "DragWindow" moves the whole window as one).

Should we ask SFR to make this function part of an official OneSwitch - or should I just keep this mod as my personal variation?

Mod as follows:

Remove "cycle" code from /usr/local/OneSwitch/radar-main
Code:
             3) "$XDOTOOL" keydown alt
                until [ "`grep "$SWITCH" $PRESS`" ]; do
                  "$XDOTOOL" key Tab
                  sleep $CYCLE_DELAY
                done
                "$XDOTOOL" keyup alt
             ;;


and replace with a slightly modified version of the "drag" code:
Code:
             3) "$XDOTOOL" keydown alt mousedown 1
                while :; do
                  align_radar
                  sleep $TRANS_DELAY
                  : > $PRESS
                  echo radar > $MODE
                  wait_for_switch
                  echo freeze > $MODE
                  move_mouse
                 
                  reset_menu
                  echo menu_3 > $MODE
                  wait_for_switch
                  echo freeze > $MODE
           
                  [[ $(<$MENU_STATE) = 0 ]] && "$XDOTOOL" keyup alt mouseup 1 && break
                done
             ;;


and then altered line 281 to change the radar display from "cycle" to "DragWindw"
Code:
      <tspan x="'$TEXT_X'" y="'$((3*$SIZE))'">DragWindw</tspan>


I could not see an easy way to make this change utilising the "custom" method but maybe there is a way to do that? (Although my preference is for the DragWindw function to be available as early as possible in the radar menu, rather than having to step too deep).

I haven't trialled this on navbar yet but I guess it will be identical.
.
DragWindow Mod.jpg
 Description   
 Filesize   43.74 KB
 Viewed   154 Time(s)

DragWindow Mod.jpg

Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Fri 02 Aug 2013, 17:02    Post subject:  

Hey Greengeek, nicely done! Smile

Good to see you're getting accustomed to the OneSwitch code, which is also good, since I need to take a serious break from computing in general soon - I badly strained my eyes lately. Rolling Eyes

Well, the idea is fair, but Radar's area is so tight that I can see (yet) only these alternatives:
1. Put it instead of other option, as you did.
2. Increase the amount of options per page to six, by decreasing font size - it's the most challenging way and the result might be unsatisfactory (too small font, ugly design).

In case of NavBar there's no reason to hesitate, because there's still some spare space (at least on my 1366px wide screen Wink ).

BTW, I'm quite surprised that it worked this way, but yes - we can utilize one of "Custom" fields, even in two ways:

1. The code has to be folded into one, single line and we can't use quotes around $XDOTOOL command:
Code:
$XDOTOOL keydown alt mousedown 1; while :; do align_radar; sleep $TRANS_DELAY; : > $PRESS; echo radar > $MODE; wait_for_switch; echo freeze > $MODE; move_mouse; reset_menu; echo menu_3 > $MODE; wait_for_switch; echo freeze > $MODE; [[ $(<$MENU_STATE) = 0 ]] && $XDOTOOL keyup alt mouseup 1 && break; done

Additionally, the code of /usr/local/OneSwitch/radar-config needs to be rectified in order to properly handle > characters in custom string i.e. all these lines:
<default>'$CUSTOM_1_EXEC'</default>
...
<default>'$CUSTOM_2_EXEC'</default>
...and so on...

have to be changed to:
Code:
<default>"'$CUSTOM_1_EXEC'"</default>

...and so on...

OR

2. Put the code into a function (within "Functions" area in /usr/local/OneSwitch/radar-main):
Code:
dragwin () {
  "$XDOTOOL" keydown alt mousedown 1
  while :; do
    align_radar
    sleep $TRANS_DELAY
    : > $PRESS
    echo radar > $MODE
    wait_for_switch
    echo freeze > $MODE
    move_mouse
    reset_menu
    echo menu_3 > $MODE
    wait_for_switch
    echo freeze > $MODE
    [[ $(<$MENU_STATE) = 0 ]] && "$XDOTOOL" keyup alt mouseup 1 && break
  done
}
export -f dragwin

and then type dragwin into one of custom fields in GUI.

But I agree, would be nice to have it closer than on 3rd page...
Besides, you're surely using/testing OneSwitch much more often and extensively than me (I'm running it only while testing the code), so it's up to you. Smile

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Fri 02 Aug 2013, 17:30    Post subject:  

Thanks SFR - some good suggestions there. It will be good to see what the consensus is with other users. I will wait for their feedback before incorporating any change.

It is good that you have a break - what you did in developing this pet is fantastic work and extremely useful and I am sure i am not alone in wanting to thank you for your handling of the coding pressure.

I imagine the heatwave there has not helped the dry eyes or the cpu temperature!
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1053

PostPosted: Sat 03 Aug 2013, 08:52    Post subject:  

greengeek wrote:
I imagine the heatwave there has not helped the dry eyes or the cpu temperature!

No doubt it hasn't... And won't be cooler for the next 2-3 weeks at least. Rolling Eyes

One more thing, before I'll take a break. Wink
I did split all parts of the "main loop" in Radar and NavBar into a separate functions.
Thanks to this the code is much more readable (no more endless levels of indentations) and easier to maintain, I hope.
Attached here for now, since I haven't tested yet if everything still works 100% correctly.
If all will be ok, this version should be a base for future development.

Thanks &
Greetings!
OneSwitch-1.4.pet
Description 
pet

 Download 
Filename  OneSwitch-1.4.pet 
Filesize  94.55 KB 
Downloaded  158 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 776
Location: Union New Jersey USA

PostPosted: Sun 04 Aug 2013, 10:40    Post subject: Changing Drag  

Hi greengeek, SFR:

Another method for including drag-window might be assigning it to one of xvkbd's function keys. There are twelve. All quickly accessible. And only the F1 and F11 keys are commonly used by applications. See attached [Even if an application assigned some routine to a function key, they is almost always a method within such application to modify the Hotkeys it uses], And since we can modify the labels xvkbd displays, the Function Key Labels can take a mnemonic: for example, if F3 were assigned the drag-window function, it could be labeled DW.

Re: Adding additional functions to radar, Radar's panels/windows currently can display only 5 choices, and after the first "compass" panel, two choices must be assigned to moving to earlier or later panels. Although radar's current first panel display -- a circle within a square-- is aesthetically pleasing, I don't think it's actually necessary. It is likely that xvkbd's keyboard will be adjacent. The result is that above radar's display is screen-space which is, for all practical purposes, unusable. Perhaps, therefore, radar's basic display could be a rectangle with greater height which would allow more choices to appear on each panel. Alternatively --or additionally-- perhaps some kind of index-paging system could be used and displayed rather than "back" and "more." "More" would bring up a list of function panels including the "compass" panel.

mikesLr
4_SimpleFunctionKeys.png
 Description   Function Keys generally not assigned functions
 Filesize   26.27 KB
 Viewed   125 Time(s)

4_SimpleFunctionKeys.png

Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Sun 04 Aug 2013, 13:19    Post subject: Re: Changing Drag  

mikeslr wrote:
The result is that above radar's display is screen-space which is, for all practical purposes, unusable. Perhaps, therefore, radar's basic display could be a rectangle with greater height which would allow more choices to appear on each panel.
Interesting idea. That will be worth experimenting with. I do feel the idea of reserving the whole righthand margin of the screen is more appropriate to widescreen displays though. (I do most of my troubleshooting on a netbook so I find that even the space above the radar display is valuable)

My first version of switchpup used XFCE which makes it very easy to totally reserve a variable width margin at any edge of the screen, and I do intend to go back to that version and refine it once I'm happy with the JWM versions.

With regard to the the idea of increasing functionality by programming the xvkbd F keys - do you find that xvkbd is always visible? On my system it does not stay visible, despite the run-time parameter of --always-on-top.

if xvkbd would stay on top I think it would be great to be able to enlarge it's Fkeys and programme some functions there. (although having said that I do sometimes prefer to NOT have xvkbd visible - although I can use a different desktop if I need more clear space...)
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 776
Location: Union New Jersey USA

PostPosted: Sun 04 Aug 2013, 15:31    Post subject: Consider using rg66's X-precise as a base  

Hi greengeek,

Once you're satisfied with SwitchPup running under jwm, you might want to consider basing a version on rg66's X-precise. http://murga-linux.com/puppy/viewtopic.php?t=87717. Although he is still working out some kinks, it is already fully functional. Xfce, like openbox and Lxde, and unlike jwm are fully XDG compliant. I think SFR mentioned somewhere not being XDG compliant is the cause of one having to use Xvkbd's focus button (and then click on desired target application) to focus output to a target application. Anything which eliminates time and key-events is a step forward. Additionally, X-Precise is "bare-bones": Add any precise application you want and not clutter the menu with applications a OneSwitch user is unlikely to use. And as rg66 mentioned, many apps from Carolina may also work.
I've actually started to built a "OneSwitch" Pup based on X-precise. With one exception the OS worked fine, as well as any other such Pup. That exception was excessive delay before Thunar opened. Rg66 quickly responded to my concern on the above thread. [I didn't mention that the delay may have been caused in part by my 2 sd drives adding up to 1.5 terabytes, divided into 9 partitions].
I stopped building to address more pressing concerns: (1) Need to revise keyboardchoices pet now that SFR built into radar's xvkbd mode's alternate scan methods and (2) general difficulty in using the Square Keyboard, suggesting that I re-think it.
What I particularly like about Xfce (and Lxde) is the ease with which a second panel, populated by launchers for frequently employed apps, can be created that remains hidden until moused-over. Launcher Icon size can be set to make them easy targets.
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2477
Location: New Zealand

PostPosted: Sun 04 Aug 2013, 16:02    Post subject:  

Sounds great. I feel like I'm not too far away from switchpup 1.0, and after that I'm keen to get into some more adventurous versions in an effort to boost productivity. I'm keen to try your X-precise when you're ready for some testers.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 5 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1426s ][ Queries: 13 (0.0374s) ][ GZIP on ]