Can F95 tell windows that a key was pressed or that something was typed?
Roger
Welcome to our forums
Can F95 tell windows that a key was pressed or that something was typed?
Roger
It is possible that you need add_keyboard_monitor@. See the help file for details.
As in the previous thread you started, there isn't enough information given in the enquiry to allow someone who wants to help you to give you an answer that you might find helpful. Moreover, it isn't clear what your level of expertise is, and thus how much of an explanation you need.
FTN95 (note, not F95, which could be anything) can work in at least four ways:
Now, we want to know if (a) you want to detect anything in the way of a keypress, or (b) whether you want to detect if a specific key (or key-chord) has been pressed.
Assuming (3) because you mentioned Windows, then in the first case (a), you probably do need to use add_keyboard_monitor@. In the second case, you can incorporate a test for a specific key combination. If I am right about approach (3), then you can add a %ac accelerator key in your WINIO@ calls, but you could also add the test for a specific key combination with add_accelerator@ (and if you wanted, remove it with remove_accelerator@). This may also work if you are using approach (2) above.
If you don't understand what I'm writing about, then you may need to start at a lower level altogether.
Eddie
Quoted from LitusSaxonicum As in the previous thread you started, there isn't enough information given in the enquiry to allow someone who wants to help you to give you an answer that you might find helpful. Moreover, it isn't clear what your level of expertise is, and thus how much of an explanation you need.
Granted. I've been programming since 1970 or so first in Fortran IV then switched to TrueBasic to do graphics. Now I need speed so back to Fortran.
FTN95 (note, not F95, which could be anything)
Granted but if it was anything else I wouldn't be here.
can work in at least four ways:
- A console application, running in a command window (aka DOS box)
- A console application running in a Windows setting (WINAPP but no Clearwin+ codes)
- A Windows application created with Clearwin+
- A .NET application - also a full Windows application.
Now, we want to know if (a) you want to detect anything in the way of a keypress, or (b) whether you want to detect if a specific key (or key-chord) has been pressed.
Assuming (3) because you mentioned Windows, then in the first case (a), you probably do need to use add_keyboard_monitor@. In the second case, you can incorporate a test for a specific key combination. If I am right about approach (3), then you can add a %ac accelerator key in your WINIO@ calls, but you could also add the test for a specific key combination with add_accelerator@ (and if you wanted, remove it with remove_accelerator@). This may also work if you are using approach (2) above.
If you don't understand what I'm writing about, then you may need to start at a lower level altogether.
Never mind. The problem was solved by someone else who didn't need any of that information. Really, the problem is the documentation here. That's not unusual. Typically in programming documents, the answer is there and the problem is figuring out what it's called.
Roger
Hi Roger,
Quite a lot of enquiries on the Forum are for basic Fortran programming, and as far as I know, standards-compliant Fortran has never had a command to allow a user to interrupt program execution at a random place that allowed a restart - PAUSE was under the control of the program. Thus it wasn't necessarily a silly question to ask if F95 in your post meant F[u:67f9b54739]ortran[/u:67f9b54739] 95 or F[u:67f9b54739]TN[/u:67f9b54739]95.
I'm as big a critic of the documentation as anyone, but where to find the answer depends on where you start from, and that wasn't clear in either of your posts.
So you solved the problem independently. Perhaps you'd care to share the answer with us ... was it, may I ask, by reading the documentation? Or have you found something the rest of us missed?
If you were running a Windows program created using FTN95 and Clearwin+ spawned by your Perl program, you could of course send a Windows message from your Perl program to halt the Fortran, but that was never given as an answer because it wasn't stated that the Fortran program was spawned from something else.
Eddie
Hi Roger,
Quite a lot of enquiries on the Forum are for basic Fortran programming, and as far as I know, standards-compliant Fortran has never had a command to allow a user to interrupt program execution at a random place that allowed a restart - PAUSE was under the control of the program. Thus it wasn't necessarily a silly question to ask if F95 in your post meant F[u:12b043ec0f]ortran[/u:12b043ec0f] 95 or F[u:12b043ec0f]TN[/u:12b043ec0f]95.
I'm as big a critic of the documentation as anyone, but where to find the answer depends on where you start from, and that wasn't clear in either of your posts.
So you solved the problem independently. Perhaps you'd care to share the answer with us ... was it, may I ask, by reading the documentation? Or have you found something the rest of us missed?
If you were running a Windows program created using FTN95 and Clearwin+ spawned by your Perl program, you could of course send a Windows message from your Perl program to halt the Fortran, but that was never given as an answer because it wasn't stated that the Fortran program was spawned from something else.
Eddie
No, I didn't solve this on my own, I got a lot of help on the other thread, which contains several other suggested solutions and I don't understand some of them.
Part of the confusion is because I'm writing this for someone else and I don't clearly understand what he wants.
Roger