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 Tue 23 Sep 2014, 06:44
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 4 of 6 [84 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
SFR


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Wed 03 Apr 2013, 08:02    Post subject:  

Quote:
I've noticed a few times that the radar screen obscures the scrollbar in many windows (especially browsers). Is it possible to move it approx 20 pixels or so to the left of the right hand screen boundary?

Done, controlled via OFFSET_H & OFFSET_V (horizontal & vertical) constants.

Quote:
...allowing the "drag" and "xvkbd" options to be de-selected somehow?

Yeah, the "main" menu became a bit clogged. Wink
I resolved this differently, mostly because I introduced new option.
Now the 'main' menu contains:
Move
L-Click
R-Click
Dbl-Click
more...


'Drag' & 'XVBD' have been moved to 'more...' submenu, as well as the new action: 'Cycle'.
'Cycle' allows to...cycle opened windows (simply - emulates Alt+Tab); delay is controlled by CYCLE_DELAY (default = 1.5 sec).

Just let me know if this approach is efficient, so I'll roll it back, if not.

____________

UPDATE: version 1.0alpha2 with added GUI for configuration purposes and to start/stop the scripts in a bit easier way.
Important change - now the main scripts are named "navbar-main" and "radar-main".
GUI is launched via "navbar-config" and "radar-config" scripts, settings will be saved inside app's directory ("radar_settings" & "navbar_settings") and if anything goes wrong, it's enough to delete those files, what will revert default settings.


Greetings!
Radar-1.0a2+NavBar-1.0a2.tar.gz
Description 
gz

 Download 
Filename  Radar-1.0a2+NavBar-1.0a2.tar.gz 
Filesize  123.8 KB 
Downloaded  239 Time(s) 
Radar-1.0a+NavBar-1.0a.tar.gz
Description 
gz

 Download 
Filename  Radar-1.0a+NavBar-1.0a.tar.gz 
Filesize  121.17 KB 
Downloaded  237 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 
ETP


Joined: 19 Oct 2010
Posts: 540
Location: UK

PostPosted: Mon 08 Apr 2013, 10:06    Post subject: Radar-1.0a2  

Hi SFR/Greengeek,

I have just tried 1.0alpha2 with added GUI and must say that it is very impressive.

The biggest issue remaining in the project is that of navigation which remains tedious and calls for too much precision. Try for example navigating to the mike icon in Google voice. The same applies to the keys on Xvkbd even when it is launched at a slightly larger size as in my beta.

My eyes were drawn however to the free line beneath Xvkbd on your Radar menu. It cries out for one last additional menu which could provide 4 further choices plus BACK. Some possibilities may be as follows:
1. ALT+F10
This toggles and can therefore give you a full screen keyboard with easier to navigate icons that require less precision. I tried it and text does indeed go to the browser or document beneath. Your cycle function is then very handy.

2 & 3. Page Up and Page Down.

Very handy for scrolling a web page/thread and documents/pdfs.

4. Return.
“Press enter to continue” together with the infamous press “Any Key” come to mind.
It would also save my bacon on the Google voice search “try again” issue. Laughing

These are just off the top of my head and 4 user configurable text & commands changeable via the Gui might be more versatile with 4 initial default values. I note that xdotool has an “exec” command and launching a program or script from Radar would be a lot easier than navigating to a configured function key on Xvkbd.

_________________
Regards ETP
Accessibility Pups: -- Magoo -- The Pup With No Name -- MouseCam -- Obedient
Back to top
View user's profile Send private message 
greengeek

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

PostPosted: Mon 08 Apr 2013, 14:14    Post subject:  

I have not had a chance to get my teeth into the latest version yet, but am hung up on an issue with NAVBAR versions 0.4 and 0.5 (which may be well suited to some of my needs because of their simplicity)

The problem is this: if I do not choose the direction quickly enough, navbar will cycle through all the arrows, then display a "blank" period for 11 seconds, then go back to displaying the arrows. This is happening on the "SwitchPup" that I have based on racyNOP532. (I have not investigated this further on other puppies yet - very little PC access at present)

NAVBAR 0.3 does not exhibit this problem so I will probably use that for further testing at the moment.
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Mon 08 Apr 2013, 16:09    Post subject:  

@ETP:
Done.
Custom options can be changed via GUI (by default - options proposed by you).

@Greengeek:
IIRC it's been fixed a couple of versions before.
If you'd like to apply the fix to an older version (eg. 0.5), just find this line:
Code:
((DIRECTION_POS++)); [ $DIRECTION_POS -ge ${#DIRECTIONS} ] && DIRECTION_POS=0

and replace it with:
Code:
((DIRECTION_POS++)); [ $DIRECTION_POS -ge $ARROWS ] && DIRECTION_POS=0

Greetings!
Radar-1.0b+NavBar-1.0b.tar.gz
Description 
gz

 Download 
Filename  Radar-1.0b+NavBar-1.0b.tar.gz 
Filesize  125.55 KB 
Downloaded  268 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 
ETP


Joined: 19 Oct 2010
Posts: 540
Location: UK

PostPosted: Tue 09 Apr 2013, 00:30    Post subject: Radar - new version  

Hi SFR,

That was quick! Many thanks, I will give it a try.
It should enable me to then produce a screen resolution agnostic remaster. Smile

_________________
Regards ETP
Accessibility Pups: -- Magoo -- The Pup With No Name -- MouseCam -- Obedient
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Tue 09 Apr 2013, 07:38    Post subject:  

mikeslr/the_other_thread wrote:
Tried switching to a second desktop. Neither xvkbd nor radar were present.

Hmm, I've never thought about it before.
But it's easy to implement using wmctrl, so:

Added:
- ability to display Radar on all workspaces (NavBar already acts this way)
- ability to display xvkbd on all workspaces (only if launched/raised from within Radar/NavBar)

Changed:
- both scripts are now in one single dir, all additional tools were moved to ./tools subdirectory (see /usr/local/OneSwitch/).
- I combined both apps into one .pet package named (as once) OneSwitch. Menu entries for Radar-config and NavBar-config will appear under Personal.

Greetings!
OneSwitch-1.0.pet
Description 
pet

 Download 
Filename  OneSwitch-1.0.pet 
Filesize  91.19 KB 
Downloaded  238 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 
greengeek

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

PostPosted: Wed 10 Apr 2013, 16:18    Post subject:  

Wow - just trialled radar1b - nice work with the gui SFR!! You've done amazing work with this whole project.
Back to top
View user's profile Send private message 
mikeslr


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

PostPosted: Thu 11 Apr 2013, 09:07    Post subject: Adaption for use with a Game Controller?  

Hi SFR,

Phenomenal work! There's a mystical tradition which teaches that the true purpose of Man is to mend the world. In the rare moments when life and distractions don't get in the way, it's that closest I feel to makng sense of it all. But then the cynic in me retorts, "No good deed goes unpunished."
So I'll pass on darkcity's post:

"I have a friend who has limited upper body strength. He can't sit up to use a keyboard but can use a game controller. Could this pup be adapted to work with a game controller. Also, is there a program for zooming in to the part of the screen? the best I've seen is a hack using xrandr modes.

Currently he can uses the PS3 browser interface well. But his computer is sitting unused."
http://murga-linux.com/puppy/viewtopic.php?p=697665#697665

As far as I can speculate, it wouldn't actually be an adaption of either NavBar or radar, but rather involve an employment of many of their subroutines, substituting the impulses from the joystick for the directional routines built into the NavBar/radar made necessary in a single-stick environment.

The following might be of value in such project:
http://linuxjoymap.sourceforge.net/
http://ubuntuforums.org/showthread.php?t=903858
http://www.epanorama.net/documents/joystick/pc_joystick.html#linuxprogramming
http://www.mjmwired.net/kernel/Documentation/input/joystick-parport.txt

Don't know if all joysticks generate the same signals. Might make sense to include a config app.

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


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Thu 11 Apr 2013, 10:32    Post subject:  

Since I don't have a joystick/gamepad I, too, can only speculate, but if he (Darkcity's friend) is able use all buttons/directions, it would be just a matter of simple script that reads state of a button and "redirects" it into xdotool, eg.:

until button 'left' is pressed; do
xdotool mousemove_relative -- -5 0
sleep 0.1
done


...something like that.

Best if someone who have such a device could review the links you gave and see if/how those methods work.

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 
darkcity


Joined: 23 May 2010
Posts: 2452
Location: near here

PostPosted: Sun 14 Apr 2013, 11:24    Post subject:  

Hi all,

Great work with Radar Navbar and One Switch.

---

Is there a simple description of these programs and how to use? I installed Radar and NavBar but could not figure them?

For example which key is 119?

Is the keycode the same as the command xev returns?

---

This thread maybe needs renaming or new thread for Radar NavBar and OneSwitch

To make them easier to find?

---
BTW - I'm going to look into using the sixaxis joypad now I have acquired one.

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Sun 14 Apr 2013, 13:26    Post subject:  

Hey Darkcity

darkcity wrote:
For example which key is 119?

Is the keycode the same as the command xev returns?

It's Pause/Break, but xev displays this key as 'keycode 110'.
I'm using this (slightly modified) piece of code written in C to detect keystrokes in Radar/NavBar.
Type:
Code:
/usr/local/OneSwitch/tools/detect_key /dev/input/event0

and press some keys to see their codes.
BTW, in my case it was always /dev/input/event0, but if no codes will appear, try to change to event1, event2 and so on...

The idea of utilizing that key came from Will/standard7452 in this thread.
standard7452 wrote:
What I did, was disassembled the keyboard to find the ic that runs let's say the pause/break key...a key that I doubt would come into conflict with normal internet surfing or email and connect the switch across the appropriate terminals to make essentially a "one button Keyboard"


darkcity wrote:
Is there a simple description of these programs and how to use? I installed Radar and NavBar but could not figure them?

To launch Radar/Navbar - press Start button in settings window.
When the action you want to perform is highlighted - simply hit Pause/Break key.
In short (in example of Radar, but NavBar works similarly):
- image of rotating radar: move mouse cursor in shown direction
- Move: go back to 'radar' mode
- L-click: left-click
- R-click: right-click
- Dbl-click: double-click
- Drag: drag (icon or window (<- by its titlebar!)) or select text
- Cycle: cycle opened windows
- XVKBD: launch/raise xvkbd (if installed); this will also initiate, so-called, "xvkbd-mode", which work this way:
Mouse cursor moves down until the chosen "switch-key" (Pause/Break by default) will be pressed, then cursor moves right until the key will be pressed again and the letter underneath the cursor will be left-clicked.
To leave xvkbd-mode simply let the cursor cross the boundary of xvkbd window (vertically or horizontally)
- and finally there are four custom actions that can be personalized in settings.
- and of course ..back to go back to previous menu, and more../custom.. to enter submenus.

I'm not too good in describing things, but I hope it's clear enough. Wink

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 
darkcity


Joined: 23 May 2010
Posts: 2452
Location: near here

PostPosted: Mon 15 Apr 2013, 02:57    Post subject:  

thanks for the description, I think one problem was not knowing the break key. hopefully i'll get chance to test later today.
_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
mikeslr


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

PostPosted: Sun 05 May 2013, 18:02    Post subject: Would it be possible to build in a Select Text Routine  

Hi SFR and All,

Hold off on the following for the moment. After posting and taking a break for dinner, I went back to the xvkbd site for other reasons but stumbled on a passage indicating that thru the property panel what it refers to as "quick modifiiers" --Shift, Ctl, etc-- can be set to locked mode. Doing so enables Shift + arrow keys (as discussed below) to function as desired. I haven't had sufficient time as yet to determine whether setting shift to locked mode interferes with anything else.
I've been exploring the possibility of putting together an environment where the user would almost never have to personally direct mouse-movements relying on radar (or NavBar) and the use of keyboard commands running under radar/NavBar's xvkbd mode. [For example, running radar in xvkbd mode, many applications respond to Alt+F to drop down their Files menu, after which selections --still using radar in xvkbd mode-- can be made with the arrow/direction keys, and such selections effectuated by generating an “Enter/Return." Similarly, an application’s routine bound to Ctl+s --usually to generate a Save--can be effectuated under radar’s xvkbd mode. But I've run into one stumbling block.
Using a standard keyboard, there's a fairly easy way to select text to be copied or cut and subsequently pasted either to somewhere else into the application where the text first appeared or into a different application. You hold down the shift key and use the arrow/directional keys to select the text and then press Ctl+c or Ctl+x to copy or cut [into clipboard/memory]; then Ctl+v to paste. That facility --indeed those keyboard commands-- appears to be almost universal in applications which permit manipulation of text. It, or something like it, would be of value to those in a One-Switch environment while composing emails, documents, working on spreadsheets, or adding words or phrases to the "words" file used in xvkbd's word-completion mode.
Unless I've missed something, as currently structured while radar (and I assume NavBar as I think they employ the same routines) enables selection via CtL+ Arrow Key while in xvkbd mode, it only permits the selection of one letter using the left or right arrows, and with great difficulty the entire line using the up arrow, or --having backspaced-- the last word by using the down arrow. I’m not even certain that Ctl+c can be used after a selection as I gave up in frustration. That’s not the fault of radar, but rather of the layout of the keyboard [which I hope to solve]. It may be possible to leave xvkbd mode, reposition the mouse and make a selection, but that abandons my objective.
So I was wondering if it were possible to devise a selection routine which either preferably remains in xvkbd mode while a selection of text was made or returns to xvkbd mode after Ctl+x. c or v are pressed. [If I understand the mechanism now employed, when Ctl or Alt or Shift is pressed radar, although returning to the scrolling routine, permits xvkbd to register the “press” and await further “presses.” What would be needed is a routine which after Ctl was pressed. if the next key were a direction/arrow key, radar would interrup scrolling until Ctr+c or Ctl+x [or Esc to cancel] were pressed. An alternative might be to assign “selection” --and the suspension of scrolling-- to one of the Function keys, perhaps used as a toggle so that a second press would be required before scrolling begins again. Perhaps F4 or F5 which, as far as I've been able to determine, aren't used by common applications. They are used by xfe, but that application provides a way of modifying keyboard commands from its default.

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


Joined: 26 Oct 2011
Posts: 1068

PostPosted: Mon 06 May 2013, 06:20    Post subject:  

Hi MikesLr

How about this:

1. As you already know there's an option in XVKBD: Main Menu -> Property... -> Lock Shift? which makes SHIFT key locked until it's pressed again.
2. I made small change in both apps: now when you're in XVKBD-mode and you're about to press Pause/Break key (in second phase - in order to "touch" a key underneath) you have an opportunity to make it more than one time.
Simply - Radar/NavBar suspends cursor movement and waits certain amount of time (adjustable via "XVKBD mode" delay option) for next signal, so repeating keystrokes is way easier and faster now.

In summary, 1+2 allows selecting text directly through XVKBD.


Note: Since previous version of NavBar uses float value in XVKBD_MODE_DELAY variable and current one uses integer, it's necessary to adjust settings in /usr/local/OneSwitch/navbar_settings file.
It must be integer, eg. if there's:
XVKBD_MODE_DELAY=1.0
it needs to be changed to, eg.:
XVKBD_MODE_DELAY=1
...or delete the old config file and create new one via GUI.
________________

EDITS:

I introduced a bug in OneSwitch-1.1 (malfunctioning "Cycle-mode" in Radar). Fixed in v1.1.1.

Version 1.1.2 - another fix, see here for details.

Version 1.1.3:
- added "Auto-restart" checkbox - if it's checked, after pressing "Stop" button in config GUI, Radar/NavBar will auto-restart in 60 seconds, unless mouse cursor movement will be detected within this time.

Greetings!
OneSwitch-1.1.3.pet
Description 
pet

 Download 
Filename  OneSwitch-1.1.3.pet 
Filesize  91.95 KB 
Downloaded  181 Time(s) 
OneSwitch-1.1.2.pet
Description 
pet

 Download 
Filename  OneSwitch-1.1.2.pet 
Filesize  91.67 KB 
Downloaded  223 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 
greengeek

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

PostPosted: Wed 03 Jul 2013, 15:30    Post subject:  

Thanks SFR - I just want to add a note to clarify this for anyone else who wants to use 1.1.3:

The purpose of the 60 second timer is so that a user who can only operate the cursor by using the Pause/Break key will not have the ability to "STOP" the radar gui permanently. If they were permitted to stop radar it would leave them unable to have any further interaction.

They can still "save and close" in order to make changes, but they just can't "stop" radar. However, radar can still be stopped as normal if this action is performed using the normal mouse.

Just another thought - if the radar user wanted to switch between radar and navbar - would they be able to do that? I can't see any way they could do so without ending up with radar still running while they tried to start navbar. Would it be possible to add another checkbox to enable "switch between radar and navbar" ? (or at least a button to trigger such a switch/toggle)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 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.1290s ][ Queries: 13 (0.0072s) ][ GZIP on ]