replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Keyboard monitoring/polling
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Keyboard monitoring/polling

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Mon Apr 05, 2010 5:03 am    Post subject: Keyboard monitoring/polling Reply with quote

G'day, folks Smile

Does FTN95 offer Fortran-callable routines peekcharqq and getcharqq for monitoring/polling the keyboard? If so, some example code of their, or their equivalent, usage would be much appreciated. As I understand things, peekcharqq checks the keyboard buffer for input and returns immediately with an indication of whether or not a character is waiting. If one is waiting, getcharqq can be invoked to retrieve the character. The two routines in combination seem to offer a way to interrupt a looping procedure without terminating the program.

P.S. I've been able to successfully call C/C++ functions from a Fortran mainline, using ftn95 and scc. See previous posts.

Eric Carwardine, in Perth, Western Australia
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Mon Apr 05, 2010 9:02 am    Post subject: Reply with quote

Eric,

Take a look at:-

get_wkey1@

which is probably the closest equivalent to what you want, otherwise the help file states you should be using ADD_KEYBOARD_MONITOR@

hope this helps,

John
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Apr 05, 2010 11:50 am    Post subject: Reply with quote

Eric,

Are you programming a console application or a windows application? And if the latter, are you planning to use Clearwin or .NET? The answers you will get rather depend on what you are trying to do.

FTN95 evolved from a Fortran-77 system (FTN77 obviously) that was based around a text screen, DOS (extended by a 32-bit extender) and graphics of the VGA or not much better type. All the text mode functions are still there in FTN95, but you won't find much about them in the FTN95.chm on-line help file. Instead, you'll need to download the FTN77 Library Reference from the Documentation page on the Silverfrost site and read it. There are many more functions available than were provided in MS Fortran (such as the routines ending in "qq"). When I've tried them, they all worked.

If you are programming for Windows, you very rarely need to poll the keyboard - I never do - as the input methods and philosophy are rather different. However, they are different between Clearwin and .NET as well!

My particular preference is for Clearwin.

Eddie
Back to top
View user's profile Send private message
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Mon Apr 05, 2010 1:03 pm    Post subject: Reply with quote

Many thanks, John and Eddie, for your responses; they are much appreciated.

What I want to do is "modernise" Fortran programs that were written before Windows was invented. For a while I was content with running those same programs in a DOS window via the DOS prompt command.com Now I want to produce a program that displays, for example, like http://www.kurrattan.net/exhibits/something_like_this.jpg when run from a Windows platform. My interest centres around the tabular part of the display, not any of the buttons at the top of the display (Although one button would be nice, which the user could mouse-click to interrupt the temperature-measuring loop without terminating the program).

In essence, the compiled ( .exe ) program would be a Fortran main calling C/C++ routines that gather thermocouple data via one of the serial COM ports. Using ftn95 and scc I've successfully "mixed" the Fortran and C/C++ Now it's time to present an attractive "shop-front" to the world Wink

Is ClearWin the way to go? I've already posted a similar query in the ClearWin forum.

Thanks again for your responses Surprised

Eric
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Apr 05, 2010 2:51 pm    Post subject: Reply with quote

Eric,

Your ambitions are modest compared to what Clearwin can do for you - you'll need a different respondent to sing the praises of .NET

Clearwin would enable you to program the window style, menus, toolbar buttons and the other features.

If you want to send me a private message with an e-mail address I'll send you my "get you started" notes on Clearwin programming.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
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


Powered by phpBB © 2001, 2005 phpBB Group