Task Alarms and shift key
Theo Markettos (89) 919 posts |
This thread: reports a problem with Alarm where a task alarm will do the wrong thing if it’s executed when the shift key is held down. This is because castle/RiscOS/Sources/Apps/Alarm/bas/Alarms line 421 is calling Filer_Run. Should it do something else (*Run?), or should there be an option to Filer_Run to run something without checking shift? |
neil.r (1738) 66 posts |
Hi, this is one of my discoveries I’m afraid… As a total RISC OS newbie, I’m a bit unsure how and where I should be asking these kind of questions. Currently I’m using the R-Pi site more than any other, as, well, I’m working under the assumption that RISC OS is a fairly mature operating system and the R-Pi distribution isn’t. So, apologies if I’m causing extra work by posting stuff in the wrong place. But, anyhow, if I can help by providing any extra information, please, just let me know. I’m keen to help where I can, as I finally feel like I’ve found my ideal desktop operating system. After about 25 years of looking. |
Sprow (202) 1158 posts |
You’re 4 years too late to ask that question! Though it doesn’t look to have made it into !Alarm. However, the downside to that switch addition is that it is faulted by earlier versions of the Filer, and since !Alarm appears in the universal disc image you’d need to detect and code around both cases. Dull. |
Steve Pampling (1551) 8170 posts |
Perfect place. If you find a strange behaviour or a nice crashing bit of code ask in Community support to check but then “Bugs” is just the spot to report the repeatable sequence that generates the problem. NB. Although the OS has been around a while, the 5.19 revisions are latest developments and particularly on the Pi are on new hardware with whole new interesting quirks. |
Theo Markettos (89) 919 posts |
I did have a funny feeling I’d seen it before somewhere… Did that make it in to the Filer? The trouble with detecting it is you can’t do a normal XOS_CLI, because that will error if the command errors, not only if the -noshift option is unsupported. So trying again without the -noshift would cause the error-ed operation to happen twice. Without doing horrid things with Filer version numbers, I can’t think of an easy way to only use it if available. |
Rik Griffin (98) 264 posts |
How about adding a SWI to the Filer (although the Filer doesn’t currently provide SWIs) that says “ignore shift key for the next Filer_Run”? Then Alarm could check whether this SWI exists, and call it if it does, before doing a Filer_Run. I’m not sure if this is much better than checking module versions though… |
Sprow (202) 1158 posts |
Yes.
Perhaps a one shot command on startup, one that was known to work, eg. SYS"XOS_CLI",“filer_run -noshift $.definitely_there_but_does_nothing” TO flagswhich could be an empty obey file for example.
That wouldn’t deal with the (already in the wild) RISC OS Select with its “-noshift” option to retrospectively have a capabilities SWI added. One sneaky thing (untested!) is to put the “-noshift” in the task alarm, since alarm passes this as OSCLI"Filer_Run "+e$Or for ultimate evil, intercept OS_Byte either side of the call and report the shift key as up when OS_Byte &81 goes past. |
Rik Griffin (98) 264 posts |
This seems suitably hacky :) It prints “yes” if the Filer understands “-noshift”.
|
nemo (145) 2546 posts |
If you’re going to use pipe, then: OSCLI"Help Filer_Run { > pipe:$.help }:Z%=0:F%=OPENIN"pipe:$.help" WHILENOTEOF#F%:Z%+=INSTR(GET$#F%,"[-noshift]"):ENDWHILE:CLOSE#F% IFZ%:P."yes":ELSEP."no" |
Rik Griffin (98) 264 posts |
This isn’t 1982, there are no prizes for writing pre-compressed BASIC :) |
nemo (145) 2546 posts |
Sadly, that’s actually how I think (and I even threw in some newlines, which is a novelty – note how I avoided having an IF in the loop)! ;-) |
WPB (1391) 352 posts |
Minor typo in nemo’s post above. Should read: OSCLI"Help Filer_Run { > pipe:$.help }":Z%=0:F%=OPENIN"pipe:$.help" WHILENOTEOF#F%:Z%+=INSTR(GET$#F%,"[-noshift]"):ENDWHILE:CLOSE#F% IFZ%:P."yes":ELSEP."no" |
Martin Avison (27) 1494 posts |
Another way of detecting the availability of -NoShift could be…
Does anyone know when NoShift was introduced? Incidentally, while researching this I discovered a Filer bug: Try
See bug report for details. |