Discussion:
directory with input focus (vs CSD)
(too old to reply)
Jim Nagel
2018-11-06 14:21:59 UTC
Permalink
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running.

The currently selected directory (CSD) is represented by "@", which I
didn't know till today.

But CSD is not the same thing as "directory with input focus" -- which is
a standard feature in newer versions of the OS (since 5.22 at least) --
ie, the directory with lit-up titlebar, to which keystrokes can be
directed such as F4 (full info) or ^W (make this the CSD).

Is there something as nifty as "@" for this newer purpose?
--
Jim Nagel www.archivemag.co.uk
"From" address is genuine but will change. Website has current one.
Theo
2018-11-06 21:58:11 UTC
Permalink
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running.
didn't know till today.
I don't think there is. The CSD is a filing system concept, accessible from
*-commands etc. The window with input focus is a desktop Filer concept, ie
purely a GUI construct, not something the underlying OS knows about.

Best I can suggest is something that looks for the window with focus and
reads its titlebar via something like Wimp_GetWindowInfo. But that won't
help if the titlebar string is truncated due to length (I'm not sure if the
Filer does that).

Theo
Andrew Conroy
2018-11-07 12:36:40 UTC
Permalink
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running.
didn't know till today.
But CSD is not the same thing as "directory with input focus" -- which
is a standard feature in newer versions of the OS (since 5.22 at
least) -- ie, the directory with lit-up titlebar, to which keystrokes
can be directed such as F4 (full info) or ^W (make this the CSD).
Perhaps if you could give an idea of what the app will do with this info
(ie. is it going to send keypresses to the window?), we might be able to
work out a way to do it?

Andrew
--
+----------------------------------------+---------------------------------+
| Andrew Conroy, Owl-Art Un-Ltd. | email: ***@argonet.co.uk |
| Coming to you on an Acorn RiscPC SA110 | |
+----------------------------------------+---------------------------------+
The impossible I can do at once, miracles take a little longer!!
John Williams (News)
2018-11-07 13:55:16 UTC
Permalink
to which keystrokes can be directed such as F4 (full info) or ^W (make
this the CSD)
The ^W one is a filer shortcut, but I suspect that the F4 is coming from
something else you have loaded - a filer-utility module!

John
--
John Williams, now back in the UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/
Jim Nagel
2018-11-07 14:00:50 UTC
Permalink
Post by Andrew Conroy
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running. [...]
Perhaps if you could give an idea of what the app will do with this info
(ie. is it going to send keypresses to the window?), we might be able to
work out a way to do it?
OK. I open a filer window, and I find it contains a number of Jpeg and
other graphics files. I want to see thumbnails of those graphics, so I
want to open the same directory with !Thump.

Of course I can go to the parent of that directory (which might be large),
scroll down to find the icon representing that directory, and drag the
icon to Thump (which in my setup is already on the iconbar). That's a bit
of palaver, tiresome because it's an operation I frequently want to do.

I'm using Ro 5.25 on ArmX6 and 5.22 on Armini-Beagle, so the directory in
question has input focus (which would not be the case in old versions of
the OS) and various keystrokes are available on the filer menu: F4 for
full info, ^W to set CSD, ^T to change filetype, etc etc.

So I'm thinking it would be nifty to set up a keystroke for "tell Thump to
display this directory". (F11 is available.)

Thump 1.53 (2015-aug-10), which is the current version from Christopher
Martin, loads to my iconbar at boot-up. I also run Quickfiler 2.24
(2015-july-19), from Martin Avison, which adds some keystrokes beyond what
the native Filer provides. (Unforch neither is listed on Plingstore.)
http://www.users.on.net/~belles/software/thump/
http://www.avisoft.force9.co.uk/QFiler.htm
--
Jim Nagel www.archivemag.co.uk
Post by Andrew Conroy
Post by Jim Nagel
"From" address is genuine but will change. Website has current one.
News
2018-11-07 14:41:31 UTC
Permalink
Post by Jim Nagel
Of course I can go to the parent of that directory (which might be
large), scroll down to find the icon representing that directory,
and drag the icon to Thump (which in my setup is already on the
iconbar). That's a bit of palaver, tiresome because it's an
operation I frequently want to do.
Why not simply drag one of the jpeg files in to !Thump. This will
open the image full (or scaled) size. Then simply close that image
with Adjust - the parent directory will open.
--
Chris Johnson
Jim Nagel
2018-11-08 02:25:38 UTC
Permalink
Why not simply drag one of the jpeg files in to !Thump. This will open the
image full (or scaled) size. Then simply close that image with Adjust -
the parent directory will open.
Thanks. A good workaround. Julian Fry replied privately with a similar
suggestion, saying Ctrl-V in Thump, which seems to do the same thing as
Adjust-close.

But I've managed to do the whole trick with !Keystroke -- see downthread.
--
Jim Nagel www.archivemag.co.uk
"From" address is genuine but will change. Website has current one.
Alan Adams
2018-11-07 14:53:47 UTC
Permalink
Post by Jim Nagel
Post by Andrew Conroy
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running. [...]
Perhaps if you could give an idea of what the app will do with this info
(ie. is it going to send keypresses to the window?), we might be able to
work out a way to do it?
OK. I open a filer window, and I find it contains a number of Jpeg and
other graphics files. I want to see thumbnails of those graphics, so I
want to open the same directory with !Thump.
Of course I can go to the parent of that directory (which might be large),
scroll down to find the icon representing that directory, and drag the
icon to Thump (which in my setup is already on the iconbar). That's a bit
of palaver, tiresome because it's an operation I frequently want to do.
I'm using Ro 5.25 on ArmX6 and 5.22 on Armini-Beagle, so the directory in
question has input focus (which would not be the case in old versions of
the OS) and various keystrokes are available on the filer menu: F4 for
full info, ^W to set CSD, ^T to change filetype, etc etc.
So I'm thinking it would be nifty to set up a keystroke for "tell Thump to
display this directory". (F11 is available.)
Thump 1.53 (2015-aug-10), which is the current version from Christopher
Martin, loads to my iconbar at boot-up. I also run Quickfiler 2.24
(2015-july-19), from Martin Avison, which adds some keystrokes beyond what
the native Filer provides. (Unforch neither is listed on Plingstore.)
http://www.users.on.net/~belles/software/thump/
http://www.avisoft.force9.co.uk/QFiler.htm
I submitted a zip file a little while ago which could be the core of
this - as this is a non-binary group I'm not sure what will happen to
it.

It polls once a second and finds the title bar of the window whicjh
currently has the input focus. (Most application windows don't return
the tiutle, but either an empty string or something random.)

The changes it would need: delete the display window, which is not
needed.
Remove setting a system variable.
Move the code into a key-pressed handler from the null handler.
Check that the title string returned is a file path - specifically
that the last entry is a directory.
Use Wimp_StartTask to launch Thump, with the path as parameter one on
the command line - ASSUMING THUMP WILL WORK THIS WAY.

I don't have time to do that just now - someone else want to have a
go?
--
Alan Adams, from Northamptonshire
***@adamshome.org.uk
http://www.nckc.org.uk/
Jim Nagel
2018-11-08 02:20:27 UTC
Permalink
Post by Alan Adams
Use Wimp_StartTask to launch Thump, with the path as parameter one on
the command line - ASSUMING THUMP WILL WORK THIS WAY.
Not sure about that; not mentioned in the Thump Stronghelp.
Will ask Christopher Martin, the maintainer.
--
Jim Nagel www.archivemag.co.uk
Post by Alan Adams
"From" address is genuine but will change. Website has current one.
druck
2018-11-08 21:58:37 UTC
Permalink
Post by Alan Adams
I submitted a zip file a little while ago which could be the core of
this - as this is a non-binary group I'm not sure what will happen to
it.
Dont post binaries of any other attachments to text only news groups.
Find some web space and post a URL.

---druck
Andrew Conroy
2018-11-07 15:01:34 UTC
Permalink
Post by Jim Nagel
Post by Andrew Conroy
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running. [...]
Perhaps if you could give an idea of what the app will do with this
info (ie. is it going to send keypresses to the window?), we might be
able to work out a way to do it?
OK. I open a filer window, and I find it contains a number of Jpeg and
other graphics files. I want to see thumbnails of those graphics, so I
want to open the same directory with !Thump.
Ok. Does Thump have a way to programatically tell it to open a folder, or
do you have to drag the folder to it's icon? (I've not used it, so don't
know). If it doesn't have a way to tell it to open a folder other than by
dragging that folder to its icon then knowing what window has input focus
isn't going to direcly help you.

Andrew
--
+----------------------------------------+---------------------------------+
| Andrew Conroy, Owl-Art Un-Ltd. | email: ***@argonet.co.uk |
| Coming to you on an Acorn RiscPC SA110 | |
+----------------------------------------+---------------------------------+
The impossible I can do at once, miracles take a little longer!!
Jim Nagel
2018-11-07 18:25:27 UTC
Permalink
Hmm. I tried !Keystroke (originally from Quantumsoft, still available from
http://quantumsoft.riscository.com ) and find an promising possibility in
its "*command" section: it can set a system variable <filer$dir>.

I can make a keystroke on my open directory-with-input-focus do something
like *filer_opendir <filer$dir> -si 500 1500 500 1500
which merely opens the same dir at a new position, but demonstrates that
the sysvar works.

But now, how could that be used to send a command to Thump ?

And if !Keystroke can set such a sysvar, could the Filer itself do that
without the overheads of the Keystroke app?
--
Jim Nagel www.archivemag.co.uk
"From" address is genuine but will change. Website has current one.
Jim Nagel
2018-11-08 02:06:53 UTC
Permalink
I tried !Keystroke ...
But now, how could that be used to send a command to Thump ?
Eureka! Cracked it using Keystroke. It was fiddly to simulate
select-clicking !Thump on the iconbar. Also had to specify the sysvar
<filer$dir> in the !Thump dialogue for "Iconbar > Quick directory (1)".
Can send details or a freestanding Keystroke Executor file to anybody who
asks.
And if !Keystroke can set such a sysvar, could the Filer itself do that
without the overheads of the Keystroke app?
That question remains. I suggest it'd be a useful addition to the Filer
or to Quickfiler.
--
Jim Nagel www.archivemag.co.uk
"From" address is genuine but will change. Website has current one.
Alan Wrigley
2018-11-07 20:24:22 UTC
Permalink
Post by Jim Nagel
OK. I open a filer window, and I find it contains a number of Jpeg and
other graphics files. I want to see thumbnails of those graphics, so I
want to open the same directory with !Thump.
I think I might be able to write a little program that does this for you
Jim. Now... do I have any spare time?

Alan
--
RISC OS - you know it makes cents
svrsig
2018-11-07 17:52:12 UTC
Permalink
Post by Jim Nagel
Is there a nifty way of specifying the directory with input focus?
What I want is to tell the path of that directory to an app that is
running.
You want a utility that sits on the icon bar and shows a 'save' dialogue from which you can drag a dummy icon onto !Thump's icon bar icon. That tells the utility how far along the icon bar that !Thumps icon bar icon is. A key press of f11 should then be intercepted by the utility to examine the title bar of the window with the input focus and to simulate a filer drag of any file that sits withinn that directory onto that icon bar icon.
druck
2018-11-08 22:02:32 UTC
Permalink
Post by svrsig
You want a utility that sits on the icon bar and shows a 'save' dialogue from which you can drag a dummy icon onto !Thump's icon bar icon. That tells the utility how far along the icon bar that !Thumps icon bar icon is.
No need for that, and it wont always work anyway, remember the iconbar
will scroll if it gets full.

You don't need any positions, you can enumerate all the icons on the
iconbar, retrieving their icon number and owning task, which is enough
information to allow you to send a message to the task simulating any
action, such as dropping a file on the iconbar icon.

---druck
Jim Nagel
2018-11-09 01:44:23 UTC
Permalink
Post by druck
You don't need any positions, you can enumerate all the icons on the
iconbar, retrieving their icon number and owning task, which is enough
information to allow you to send a message to the task simulating any
action, such as dropping a file on the iconbar icon.
It's been done already. Check out the module called Window Open. I found
that it neatly solves the puzzle I had in starting this thread: a quick
way to send the active filer directory to Thump to show thumbnail images.
Christopher Martin, the maintainer of Thump, suggested Window Open.

Result is that Alt-T now does the trick. It uses the Keystroke utility to
execute this one simple command: *WO_openwind Thump <filer$dir> Magic!

Window Open offers a number of other interesting commands, such as
ensuring a task is running or removing one that is running, moving a
window, etc. Available from http://armclub.org.uk/free
Originally by DEEJ, it was 32-bitted in 2002 by somebody called Druck.
;-)
--
Jim Nagel www.archivemag.co.uk
Post by druck
"From" address is genuine but will change. Website has current one.
John Williams (News)
2018-11-09 08:15:11 UTC
Permalink
druck wrote [snip] the module called Window Open.
Gosh - that was a judicious bit of snipping!

John
--
John Williams, now back in the UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/
John Williams (News)
2018-11-09 08:30:35 UTC
Permalink
Post by Jim Nagel
Originally by DEEJ,
David John
Post by Jim Nagel
it was 32-bitted in 2002 by somebody called Druck.
David John Ruck!
--
John Williams, now back in the UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject!
Who is John Williams? http://petit.four.free.fr/picindex/author/
Alan Wrigley
2018-11-09 09:55:19 UTC
Permalink
Post by Jim Nagel
Result is that Alt-T now does the trick. It uses the Keystroke utility to
execute this one simple command: *WO_openwind Thump <filer$dir> Magic!
Ah, it sounds as though you no longer need the little program I started
writing for you which will load a directory simply by dragging one of its
files to Thump.

Alan
--
RISC OS - you know it makes cents
Jim Nagel
2018-11-09 11:22:56 UTC
Permalink
Post by Alan Wrigley
Ah, it sounds as though you no longer need the little program I started
writing for you which will load a directory simply by dragging one of its
files to Thump.
Indeed, but thanks for offering, Alan.
Just an academic question now: Your general approach was that when a
file is dragged, its *parent* dir would be fed to the target?
--
Jim Nagel www.archivemag.co.uk
Post by Alan Wrigley
"From" address is genuine but will change. Website has current one.
Alan Wrigley
2018-11-09 14:20:29 UTC
Permalink
Post by Jim Nagel
Just an academic question now: Your general approach was that when a
file is dragged, its *parent* dir would be fed to the target?
Yes, that's precisely what it would do.

Alan
--
RISC OS - you know it makes cents
Peter Young
2018-11-09 11:14:52 UTC
Permalink
Post by Jim Nagel
Post by druck
You don't need any positions, you can enumerate all the icons on the
iconbar, retrieving their icon number and owning task, which is enough
information to allow you to send a message to the task simulating any
action, such as dropping a file on the iconbar icon.
It's been done already. Check out the module called Window Open. I found
that it neatly solves the puzzle I had in starting this thread: a quick
way to send the active filer directory to Thump to show thumbnail images.
Christopher Martin, the maintainer of Thump, suggested Window Open.
Result is that Alt-T now does the trick. It uses the Keystroke utility to
execute this one simple command: *WO_openwind Thump <filer$dir> Magic!
Window Open offers a number of other interesting commands, such as
ensuring a task is running or removing one that is running, moving a
window, etc. Available from http://armclub.org.uk/free
Originally by DEEJ, it was 32-bitted in 2002 by somebody called Druck.
;-)
That sounds interesting. Where does the module go?

Best wishes,

Peter.
--
Peter Young and family
Prestbury, Cheltenham, Glos. GL52, England
http://pnyoung.orpheusweb.co.uk
***@ormail.co.uk
Jim Nagel
2018-11-09 11:49:56 UTC
Permalink
Post by Peter Young
Where does the module go?
I put it in !Boot.choices.tasks

And I have always had a dir called $.Apps-jnotes with a folder for each
app holding documentation and my own notes about it -- so the
documentation for the Window Open module went there, here.
--
Jim Nagel www.archivemag.co.uk
Post by Peter Young
"From" address is genuine but will change. Website has current one.
Peter Young
2018-11-09 12:26:08 UTC
Permalink
Post by Jim Nagel
Post by Peter Young
Where does the module go?
I put it in !Boot.choices.tasks
Thanks, and dunnit.
Post by Jim Nagel
And I have always had a dir called $.Apps-jnotes with a folder for each
app holding documentation and my own notes about it -- so the
documentation for the Window Open module went there, here.
Yes, I have a similar system

Best wishes,

Peter.
--
Peter Young and family
Prestbury, Cheltenham, Glos. GL52, England
http://pnyoung.orpheusweb.co.uk
***@ormail.co.uk
Loading...