Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Get Key Function?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Duffy  
View profile  
 More options May 4 2009, 6:15 pm
Newsgroups: comp.lang.fortran
From: David Duffy <dav...@orpheus.qimr.edu.au>
Date: Mon, 4 May 2009 22:15:13 +0000 (UTC)
Local: Mon, May 4 2009 6:15 pm
Subject: Re: Get Key Function?

nuclear.wing...@gmail.com wrote:
> I've been searching around the message board for information on a "Get
> Key" function for Fortran - the ability to have a program read input
> from a keyboard without having to push enter - and I've found a few
> posts that explain the difficulty of this.  However, the posts I could
> find were at least a decade old, some older than that.
> Have there been any recent developments (or tricks) that would allow
> for input that doesn't require pressing the return key?  If it helps,
> I'm using g95.

Not recent, but the curses library reads the terminfo database to find
out how to do this for your terminal and OS.  There is an old shareware
library (Fortran 77) fcurses, which among other things includes a
demonstration popup calculator (reads function keys, numeric keypad
etc).  The curses library has:

getch(3NCURSES)

NAME
       getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get (or push back)
       characters from curses terminal

so this could probably be called directly using the Fortran 2003 FFI.

Cheers, David Duffy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.