Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6671 > unrolled thread

ncurses on Linux how to capture F1 key?

Started bycrankypuss <no@email.thanks>
First post2012-07-27 04:42 -0600
Last post2012-08-01 07:34 -0400
Articles 20 on this page of 22 — 7 participants

Back to article view | Back to comp.lang.php


Contents

  ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-27 04:42 -0600
    Re: ncurses on Linux how to capture F1 key? dickey@his.com - 2012-07-27 04:00 -0700
      Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-27 10:29 -0600
        Re: ncurses on Linux how to capture F1 key? dickey@his.com - 2012-07-28 04:45 -0700
          Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-28 05:50 -0600
            Re: ncurses on Linux how to capture F1 key? Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-28 08:39 -0400
              Re: ncurses on Linux how to capture F1 key? "J.O. Aho" <user@example.net> - 2012-07-28 15:21 +0200
                Re: ncurses on Linux how to capture F1 key? Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-28 10:15 -0400
                Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-29 03:54 -0600
                  Re: ncurses on Linux how to capture F1 key? "J.O. Aho" <user@example.net> - 2012-07-29 13:31 +0200
                    Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-30 05:07 -0600
                      Re: ncurses on Linux how to capture F1 key? "J.O. Aho" <user@example.net> - 2012-07-30 18:27 +0200
                  Re: ncurses on Linux how to capture F1 key? Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-29 21:13 -0400
                    Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-30 05:08 -0600
                      Re: ncurses on Linux how to capture F1 key? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-07-30 07:09 -0500
                        Re: ncurses on Linux how to capture F1 key? Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-30 10:39 -0400
            Re: ncurses on Linux how to capture F1 key? legalize+jeeves@mail.xmission.com (Richard) - 2012-07-30 18:53 +0000
              Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-07-31 04:43 -0600
                Re: ncurses on Linux how to capture F1 key? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-07-31 08:03 -0500
        Re: ncurses on Linux how to capture F1 key? Norman Peelman <npeelmandog@cfl.rr.com> - 2012-07-31 22:08 -0400
          Re: ncurses on Linux how to capture F1 key? crankypuss <no@email.thanks> - 2012-08-01 02:43 -0600
            Re: ncurses on Linux how to capture F1 key? Norman Peelman <npeelmandog@cfl.rr.com> - 2012-08-01 07:34 -0400

Page 1 of 2  [1] 2  Next page →


#6671 — ncurses on Linux how to capture F1 key?

Fromcrankypuss <no@email.thanks>
Date2012-07-27 04:42 -0600
Subjectncurses on Linux how to capture F1 key?
Message-ID<jutra212bev@news6.newsguy.com>
Using the C interface the incantation is "keypad(stdscr, TRUE)"

What is the equivalent using the PHP interface to ncurses?

Pressing F1 just brings up gnome help (running in xterm under ubuntu 11.10).

[toc] | [next] | [standalone]


#6672

Fromdickey@his.com
Date2012-07-27 04:00 -0700
Message-ID<591cbfc9-6e5f-497d-b84d-c225c1fbbce9@googlegroups.com>
In reply to#6671
On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
> Using the C interface the incantation is &quot;keypad(stdscr, TRUE)&quot;
> 
> What is the equivalent using the PHP interface to ncurses?
> 
> Pressing F1 just brings up gnome help (running in xterm under ubuntu 11.10).

that sounds as if you're using one of the vte-based hacks such as gnome-terminal,
which hijack some keys - have to fix that by undoing the item in their respective
setup dialogs.

[toc] | [prev] | [next] | [standalone]


#6676

Fromcrankypuss <no@email.thanks>
Date2012-07-27 10:29 -0600
Message-ID<juufm301b7q@news3.newsguy.com>
In reply to#6672
On 07/27/2012 05:00 AM, dickey@his.com wrote:
> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>> Using the C interface the incantation is &quot;keypad(stdscr, TRUE)&quot;
>>
>> What is the equivalent using the PHP interface to ncurses?
>>
>> Pressing F1 just brings up gnome help (running in xterm under ubuntu 11.10).
>
> that sounds as if you're using one of the vte-based hacks such as gnome-terminal,
> which hijack some keys - have to fix that by undoing the item in their respective
> setup dialogs.
>

I'm using "xterm" and also on a cli (non-GUI) login... terminal type is 
either "xterm" or "linux".  Less stuff grabbed as Linux console.

Any additional pointers/keywords I can use to find out more about 
"undoing the item"?

Thanks.

[toc] | [prev] | [next] | [standalone]


#6680

Fromdickey@his.com
Date2012-07-28 04:45 -0700
Message-ID<50a5726e-f706-4a98-8f47-e6644422f14f@googlegroups.com>
In reply to#6676
On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
> On 07/27/2012 05:00 AM, dickey@his.com wrote:
> 
> > On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
> 
> >> Using the C interface the incantation is &quot;keypad(stdscr, TRUE)&quot;
> 
> >>
> 
> >> What is the equivalent using the PHP interface to ncurses?
> 
> >>
> 
> >> Pressing F1 just brings up gnome help (running in xterm under ubuntu 11.10).
> 
> >
> 
> > that sounds as if you're using one of the vte-based hacks such as gnome-terminal,
> 
> > which hijack some keys - have to fix that by undoing the item in their respective
> 
> > setup dialogs.
> 
> >
> 
> 
> 
> I'm using "xterm" and also on a cli (non-GUI) login... terminal type is 
> 
> either "xterm" or "linux".  Less stuff grabbed as Linux console.
> 
> 
> 
> Any additional pointers/keywords I can use to find out more about 
> 
> "undoing the item"?

On a non-GUI login, I wouldn't expect a help-menu (puzzled there).  For xterm in a desktop, I suppose it's possible for the window-manager to have F1 bound (Mac OS X's settings do this with some of the function keys, though I've disabled most of those...).

[toc] | [prev] | [next] | [standalone]


#6681

Fromcrankypuss <no@email.thanks>
Date2012-07-28 05:50 -0600
Message-ID<jv0jmp12jel@news7.newsguy.com>
In reply to#6680
On 07/28/2012 05:45 AM, dickey@his.com wrote:
> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>
>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>
>>>> Using the C interface the incantation is &quot;keypad(stdscr, TRUE)&quot;
>>
>>>>
>>
>>>> What is the equivalent using the PHP interface to ncurses?
>>
>>>>
>>
>>>> Pressing F1 just brings up gnome help (running in xterm under ubuntu 11.10).
>>
>>>
>>
>>> that sounds as if you're using one of the vte-based hacks such as gnome-terminal,
>>
>>> which hijack some keys - have to fix that by undoing the item in their respective
>>
>>> setup dialogs.
>>
>>>
>>
>>
>>
>> I'm using "xterm" and also on a cli (non-GUI) login... terminal type is
>>
>> either "xterm" or "linux".  Less stuff grabbed as Linux console.
>>
>>
>>
>> Any additional pointers/keywords I can use to find out more about
>>
>> "undoing the item"?
>
> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).  For xterm in a desktop, I suppose it's possible for the window-manager to have F1 bound (Mac OS X's settings do this with some of the function keys, though I've disabled most of those...).
>

On the non-GUI login the F1 key is readily available.

Other keys, like ctl-C and ctl-alt-D are firmly bound.

Can you offer any information about how to modify this on Linux?  I'm 
relatively new to Linux and don't know where that is controlled.

[toc] | [prev] | [next] | [standalone]


#6682

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-07-28 08:39 -0400
Message-ID<jv0mie$ucp$2@dont-email.me>
In reply to#6681
On 7/28/2012 7:50 AM, crankypuss wrote:
> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>
>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>
>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>> TRUE)&quot;
>>>
>>>>>
>>>
>>>>> What is the equivalent using the PHP interface to ncurses?
>>>
>>>>>
>>>
>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>> ubuntu 11.10).
>>>
>>>>
>>>
>>>> that sounds as if you're using one of the vte-based hacks such as
>>>> gnome-terminal,
>>>
>>>> which hijack some keys - have to fix that by undoing the item in
>>>> their respective
>>>
>>>> setup dialogs.
>>>
>>>>
>>>
>>>
>>>
>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal type is
>>>
>>> either "xterm" or "linux".  Less stuff grabbed as Linux console.
>>>
>>>
>>>
>>> Any additional pointers/keywords I can use to find out more about
>>>
>>> "undoing the item"?
>>
>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>> For xterm in a desktop, I suppose it's possible for the window-manager
>> to have F1 bound (Mac OS X's settings do this with some of the
>> function keys, though I've disabled most of those...).
>>
>
> On the non-GUI login the F1 key is readily available.
>
> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>
> Can you offer any information about how to modify this on Linux?  I'm
> relatively new to Linux and don't know where that is controlled.

Try a Linux newsgroup.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#6683

From"J.O. Aho" <user@example.net>
Date2012-07-28 15:21 +0200
Message-ID<a7i7agF3sfU1@mid.individual.net>
In reply to#6682
Jerry Stuckle wrote:
> On 7/28/2012 7:50 AM, crankypuss wrote:
>> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>>
>>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>
>>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>>> TRUE)&quot;
>>>>
>>>>>>
>>>>
>>>>>> What is the equivalent using the PHP interface to ncurses?
>>>>
>>>>>>
>>>>
>>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>>> ubuntu 11.10).
>>>>
>>>>>
>>>>
>>>>> that sounds as if you're using one of the vte-based hacks such as
>>>>> gnome-terminal,
>>>>
>>>>> which hijack some keys - have to fix that by undoing the item in
>>>>> their respective
>>>>
>>>>> setup dialogs.
>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal type is
>>>>
>>>> either "xterm" or "linux". Less stuff grabbed as Linux console.
>>>>
>>>>
>>>>
>>>> Any additional pointers/keywords I can use to find out more about
>>>>
>>>> "undoing the item"?
>>>
>>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>>> For xterm in a desktop, I suppose it's possible for the window-manager
>>> to have F1 bound (Mac OS X's settings do this with some of the
>>> function keys, though I've disabled most of those...).
>>>
>>
>> On the non-GUI login the F1 key is readily available.
>>
>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>>
>> Can you offer any information about how to modify this on Linux? I'm
>> relatively new to Linux and don't know where that is controlled.
>
> Try a Linux newsgroup.

Quite bored of crankys posts, so I hope he will not. I suggest he would read 
documentation for once, if he had done that he may have read the following:

Quoted from the ncurses_programming_howto:
Normally the terminal driver buffers the characters a user types until a new 
line or carriage return is encountered. But most programs require that the 
characters be available as soon as the user types them. The above two 
functions are used to disable line buffering. The difference between these two 
functions is in the way control characters like suspend (CTRL-Z), interrupt 
and quit (CTRL-C) are passed to the program. In the raw() mode these 
characters are directly passed to the program without generating a signal. In 
the cbreak() mode these control characters are interpreted as any other 
character by the terminal driver.


I guess his program is waiting for a return which you don't get when you just 
press a function key.

As he is a gnome2 fan boy, he may need to disable the hot key F1 (if it's 
possible in gnome2, as mr Havoc was so kind and thought the less configuration 
options the less confused would the users be, so you can't do half of the 
stuff you could do in Miguel de Icaza's Gnome).

-- 

   //Aho

[toc] | [prev] | [next] | [standalone]


#6684

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-07-28 10:15 -0400
Message-ID<jv0s5q$unl$1@dont-email.me>
In reply to#6683
On 7/28/2012 9:21 AM, J.O. Aho wrote:
> Jerry Stuckle wrote:
>> On 7/28/2012 7:50 AM, crankypuss wrote:
>>> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>>>
>>>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>>
>>>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>>>> TRUE)&quot;
>>>>>
>>>>>>>
>>>>>
>>>>>>> What is the equivalent using the PHP interface to ncurses?
>>>>>
>>>>>>>
>>>>>
>>>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>>>> ubuntu 11.10).
>>>>>
>>>>>>
>>>>>
>>>>>> that sounds as if you're using one of the vte-based hacks such as
>>>>>> gnome-terminal,
>>>>>
>>>>>> which hijack some keys - have to fix that by undoing the item in
>>>>>> their respective
>>>>>
>>>>>> setup dialogs.
>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal
>>>>> type is
>>>>>
>>>>> either "xterm" or "linux". Less stuff grabbed as Linux console.
>>>>>
>>>>>
>>>>>
>>>>> Any additional pointers/keywords I can use to find out more about
>>>>>
>>>>> "undoing the item"?
>>>>
>>>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>>>> For xterm in a desktop, I suppose it's possible for the window-manager
>>>> to have F1 bound (Mac OS X's settings do this with some of the
>>>> function keys, though I've disabled most of those...).
>>>>
>>>
>>> On the non-GUI login the F1 key is readily available.
>>>
>>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>>>
>>> Can you offer any information about how to modify this on Linux? I'm
>>> relatively new to Linux and don't know where that is controlled.
>>
>> Try a Linux newsgroup.
>
> Quite bored of crankys posts, so I hope he will not. I suggest he would
> read documentation for once, if he had done that he may have read the
> following:
>
> Quoted from the ncurses_programming_howto:
> Normally the terminal driver buffers the characters a user types until a
> new line or carriage return is encountered. But most programs require
> that the characters be available as soon as the user types them. The
> above two functions are used to disable line buffering. The difference
> between these two functions is in the way control characters like
> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
> In the raw() mode these characters are directly passed to the program
> without generating a signal. In the cbreak() mode these control
> characters are interpreted as any other character by the terminal driver.
>
>
> I guess his program is waiting for a return which you don't get when you
> just press a function key.
>

Which has absolutely nothing to do with his question - which is why I 
suggested a Linux newsgroup.

> As he is a gnome2 fan boy, he may need to disable the hot key F1 (if
> it's possible in gnome2, as mr Havoc was so kind and thought the less
> configuration options the less confused would the users be, so you can't
> do half of the stuff you could do in Miguel de Icaza's Gnome).
>

That may be closer to his question, but it's hard to tell without more 
information.  And there are much better newsgroups to get his answer.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#6685

Fromcrankypuss <no@email.thanks>
Date2012-07-29 03:54 -0600
Message-ID<jv3185016jv@news3.newsguy.com>
In reply to#6683
On 07/28/2012 07:21 AM, J.O. Aho wrote:
> Jerry Stuckle wrote:
>> On 7/28/2012 7:50 AM, crankypuss wrote:
>>> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>>>
>>>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>>
>>>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>>>> TRUE)&quot;
>>>>>
>>>>>>>
>>>>>
>>>>>>> What is the equivalent using the PHP interface to ncurses?
>>>>>
>>>>>>>
>>>>>
>>>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>>>> ubuntu 11.10).
>>>>>
>>>>>>
>>>>>
>>>>>> that sounds as if you're using one of the vte-based hacks such as
>>>>>> gnome-terminal,
>>>>>
>>>>>> which hijack some keys - have to fix that by undoing the item in
>>>>>> their respective
>>>>>
>>>>>> setup dialogs.
>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal
>>>>> type is
>>>>>
>>>>> either "xterm" or "linux". Less stuff grabbed as Linux console.
>>>>>
>>>>>
>>>>>
>>>>> Any additional pointers/keywords I can use to find out more about
>>>>>
>>>>> "undoing the item"?
>>>>
>>>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>>>> For xterm in a desktop, I suppose it's possible for the window-manager
>>>> to have F1 bound (Mac OS X's settings do this with some of the
>>>> function keys, though I've disabled most of those...).
>>>>
>>>
>>> On the non-GUI login the F1 key is readily available.
>>>
>>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>>>
>>> Can you offer any information about how to modify this on Linux? I'm
>>> relatively new to Linux and don't know where that is controlled.
>>
>> Try a Linux newsgroup.
>
> Quite bored of crankys posts, so I hope he will not.

That goes both ways.

> I suggest he would
> read documentation for once, if he had done that he may have read the
> following:
>
> Quoted from the ncurses_programming_howto:

You quote the C-language interface documentation.  Take a look at the 
close-to-nonexistent documentation for the PHP interface sometime.

> Normally the terminal driver buffers the characters a user types until a
> new line or carriage return is encountered. But most programs require
> that the characters be available as soon as the user types them. The
> above two functions are used to disable line buffering. The difference
> between these two functions is in the way control characters like
> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
> In the raw() mode these characters are directly passed to the program
> without generating a signal. In the cbreak() mode these control
> characters are interpreted as any other character by the terminal driver.

The code is running in cbreak() mode.

> I guess his program is waiting for a return which you don't get when you
> just press a function key.
>
> As he is a gnome2 fan boy,

Jump to fewer conclusions.  If I were a gnome2 fanboy I'd be using 
something like GTK+

> he may need to disable the hot key F1 (if
> it's possible in gnome2, as mr Havoc was so kind and thought the less
> configuration options the less confused would the users be, so you can't
> do half of the stuff you could do in Miguel de Icaza's Gnome).

Indeed, in the Linux newsgroups people "like you" don't even know "if 
it's possible in gnome2".

[toc] | [prev] | [next] | [standalone]


#6686

From"J.O. Aho" <user@example.net>
Date2012-07-29 13:31 +0200
Message-ID<a7kl88F2auU1@mid.individual.net>
In reply to#6685
crankypuss wrote:
> On 07/28/2012 07:21 AM, J.O. Aho wrote:

>> I suggest he would
>> read documentation for once, if he had done that he may have read the
>> following:
>>
>> Quoted from the ncurses_programming_howto:
>
> You quote the C-language interface documentation. Take a look at the
> close-to-nonexistent documentation for the PHP interface sometime.

Yes, as that is what you have as the PHP is more or less a wrapper and the C 
documentation is what is used as base to many of the extensions for PHP.

There is a short article in the devzone how to use ncurses, the code there has 
no issues with function keys.


>> Normally the terminal driver buffers the characters a user types until a
>> new line or carriage return is encountered. But most programs require
>> that the characters be available as soon as the user types them. The
>> above two functions are used to disable line buffering. The difference
>> between these two functions is in the way control characters like
>> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
>> In the raw() mode these characters are directly passed to the program
>> without generating a signal. In the cbreak() mode these control
>> characters are interpreted as any other character by the terminal driver.
>
> The code is running in cbreak() mode.
>
>> I guess his program is waiting for a return which you don't get when you
>> just press a function key.
>>
>> As he is a gnome2 fan boy,
>
> Jump to fewer conclusions. If I were a gnome2 fanboy I'd be using something
> like GTK+

What's the options, you provide so huge amount of information that you can't 
do anything else than make conclusions, as there are nothing to go on and you 
said you "F1 just brings up gnome help". No examples of your code or nothing, 
it's like calling your local car shop and tell, "my car don't start, what's 
wrong?".


>> he may need to disable the hot key F1 (if
>> it's possible in gnome2, as mr Havoc was so kind and thought the less
>> configuration options the less confused would the users be, so you can't
>> do half of the stuff you could do in Miguel de Icaza's Gnome).
>
> Indeed, in the Linux newsgroups people "like you" don't even know "if it's
> possible in gnome2".

Gnome2 is made as limited as possible, as the project leader after Miguel had 
an idea that end users are stupid, so to not make them confused, remove all 
the configuration options from Gnome and if someone complained about things, 
just call them trolls or delete their posts in the forums and he even told 
Linus Torvalds that the creator of Linux didn't understand how a graphical 
desktop should be when Torvalds pointed out some of the short comings of Gnome2.

Do you think that kind of management makes more experienced users want to 
stick with Gnome2, no those switched to something else if they had been using 
Gnome and not caring how to do this or that in Gnome2.

-- 

   //Aho

[toc] | [prev] | [next] | [standalone]


#6689

Fromcrankypuss <no@email.thanks>
Date2012-07-30 05:07 -0600
Message-ID<jv5ptn02t86@news4.newsguy.com>
In reply to#6686
On 07/29/2012 05:31 AM, J.O. Aho wrote:
> crankypuss wrote:
>> On 07/28/2012 07:21 AM, J.O. Aho wrote:
>
>>> I suggest he would
>>> read documentation for once, if he had done that he may have read the
>>> following:
>>>
>>> Quoted from the ncurses_programming_howto:
>>
>> You quote the C-language interface documentation. Take a look at the
>> close-to-nonexistent documentation for the PHP interface sometime.
>
> Yes, as that is what you have as the PHP is more or less a wrapper and
> the C documentation is what is used as base to many of the extensions
> for PHP.

Unfortunately PHP doesn't provide a very "pure" interface to the C 
functionality, and what /is/ provided at the PHP level is "currently not 
documented; only its argument list is available", often with no argument 
definitions.  It's a half-done interface, and some things that /are/ 
documented (like NCURSES_KEY_MAX) are undefined.

> There is a short article in the devzone how to use ncurses, the code
> there has no issues with function keys.

I assume you are referring to:
	http://devzone.zend.com/173/using-ncurses-in-php/

I notice all the clever line-through semi-corrections there, very cute. 
  In short, it's pablum.  It fails to even *address* the idea of 
function keys, and doesn't mention little details like 
extended-attributes clashing with user-defined colors.  I've been 
looking at similar entry-level writeups for months.  Of all the 
PHP-ncurses descriptions and "tutorials" I've found on the web (and 
there are dozens) I saw only /one/ article that even mentioned one of 
the two ways to implement a non-blocking getch() using only PHP 
functionality.

Yeah, if you want something really simple, those babytalk articles are 
just fine... at least, better than nothing.

>>> Normally the terminal driver buffers the characters a user types until a
>>> new line or carriage return is encountered. But most programs require
>>> that the characters be available as soon as the user types them. The
>>> above two functions are used to disable line buffering. The difference
>>> between these two functions is in the way control characters like
>>> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
>>> In the raw() mode these characters are directly passed to the program
>>> without generating a signal. In the cbreak() mode these control
>>> characters are interpreted as any other character by the terminal
>>> driver.
>>
>> The code is running in cbreak() mode.
>>
>>> I guess his program is waiting for a return which you don't get when you
>>> just press a function key.
>>>
>>> As he is a gnome2 fan boy,
>>
>> Jump to fewer conclusions. If I were a gnome2 fanboy I'd be using
>> something
>> like GTK+
>
> What's the options, you provide so huge amount of information that you
> can't do anything else than make conclusions, as there are nothing to go
> on and you said you "F1 just brings up gnome help". No examples of your
> code or nothing, it's like calling your local car shop and tell, "my car
> don't start, what's wrong?".

So you think I should post the 6700+ lines of partially complete 
interface code I've written to deal with ncurses in civilized fashion, 
plus the dozens (or hundreds) of support routines, *AND* the application 
code on top of that so you can whine about excessive information instead 
of just answering the question asked or ignoring it and going about your 
business?  Not going to happen here, suck it up and deal.

>>> he may need to disable the hot key F1 (if
>>> it's possible in gnome2, as mr Havoc was so kind and thought the less
>>> configuration options the less confused would the users be, so you can't
>>> do half of the stuff you could do in Miguel de Icaza's Gnome).
>>
>> Indeed, in the Linux newsgroups people "like you" don't even know "if
>> it's
>> possible in gnome2".
>
> Gnome2 is made as limited as possible, as the project leader after
> Miguel had an idea that end users are stupid, so to not make them
> confused, remove all the configuration options from Gnome and if someone
> complained about things, just call them trolls or delete their posts in
> the forums and he even told Linus Torvalds that the creator of Linux
> didn't understand how a graphical desktop should be when Torvalds
> pointed out some of the short comings of Gnome2.

Sort of like you thinking anyone who asks a question is stupid so just 
call them trolls and blow them off?  Yeah, it's a despicable attitude.

> Do you think that kind of management makes more experienced users want
> to stick with Gnome2, no those switched to something else if they had
> been using Gnome and not caring how to do this or that in Gnome2.

There are lots of things that I think suck major ass, but I can't fix 
them all at once.

[toc] | [prev] | [next] | [standalone]


#6693

From"J.O. Aho" <user@example.net>
Date2012-07-30 18:27 +0200
Message-ID<a7nqvaF1dcU1@mid.individual.net>
In reply to#6689
On 30/07/12 13:07, crankypuss wrote:
> On 07/29/2012 05:31 AM, J.O. Aho wrote:

>> There is a short article in the devzone how to use ncurses, the code
>> there has no issues with function keys.
>
> I assume you are referring to:
>      http://devzone.zend.com/173/using-ncurses-in-php/
>
> I notice all the clever line-through semi-corrections there, very cute.
>   In short, it's pablum.  It fails to even *address* the idea of
> function keys, and doesn't mention little details like
> extended-attributes clashing with user-defined colors.

If you do check for which value the variable $y has and compare with the 
value which ncurses thinks a F1 key has (see the key const documentation).

If you still have issues, then see to that your DE don't capture the key.


> So you think I should post the 6700+ lines of partially complete
> interface code I've written to deal with ncurses in civilized fashion,
> plus the dozens (or hundreds) of support routines, *AND* the application
> code on top of that so you can whine about excessive information instead
> of just answering the question asked or ignoring it and going about your
> business?  Not going to happen here, suck it up and deal.

Still your key capturing part of the application ain't 100% of the code 
base, but if you want to paste everything there is pastebin.com and just 
post the link to the paste.


-- 

   //Aho

[toc] | [prev] | [next] | [standalone]


#6687

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-07-29 21:13 -0400
Message-ID<jv4n3v$lmo$2@dont-email.me>
In reply to#6685
On 7/29/2012 5:54 AM, crankypuss wrote:
> On 07/28/2012 07:21 AM, J.O. Aho wrote:
>> Jerry Stuckle wrote:
>>> On 7/28/2012 7:50 AM, crankypuss wrote:
>>>> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>>>>
>>>>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>>>
>>>>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>>>>> TRUE)&quot;
>>>>>>
>>>>>>>>
>>>>>>
>>>>>>>> What is the equivalent using the PHP interface to ncurses?
>>>>>>
>>>>>>>>
>>>>>>
>>>>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>>>>> ubuntu 11.10).
>>>>>>
>>>>>>>
>>>>>>
>>>>>>> that sounds as if you're using one of the vte-based hacks such as
>>>>>>> gnome-terminal,
>>>>>>
>>>>>>> which hijack some keys - have to fix that by undoing the item in
>>>>>>> their respective
>>>>>>
>>>>>>> setup dialogs.
>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal
>>>>>> type is
>>>>>>
>>>>>> either "xterm" or "linux". Less stuff grabbed as Linux console.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Any additional pointers/keywords I can use to find out more about
>>>>>>
>>>>>> "undoing the item"?
>>>>>
>>>>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>>>>> For xterm in a desktop, I suppose it's possible for the window-manager
>>>>> to have F1 bound (Mac OS X's settings do this with some of the
>>>>> function keys, though I've disabled most of those...).
>>>>>
>>>>
>>>> On the non-GUI login the F1 key is readily available.
>>>>
>>>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>>>>
>>>> Can you offer any information about how to modify this on Linux? I'm
>>>> relatively new to Linux and don't know where that is controlled.
>>>
>>> Try a Linux newsgroup.
>>
>> Quite bored of crankys posts, so I hope he will not.
>
> That goes both ways.
>
>> I suggest he would
>> read documentation for once, if he had done that he may have read the
>> following:
>>
>> Quoted from the ncurses_programming_howto:
>
> You quote the C-language interface documentation.  Take a look at the
> close-to-nonexistent documentation for the PHP interface sometime.
>
>> Normally the terminal driver buffers the characters a user types until a
>> new line or carriage return is encountered. But most programs require
>> that the characters be available as soon as the user types them. The
>> above two functions are used to disable line buffering. The difference
>> between these two functions is in the way control characters like
>> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
>> In the raw() mode these characters are directly passed to the program
>> without generating a signal. In the cbreak() mode these control
>> characters are interpreted as any other character by the terminal driver.
>
> The code is running in cbreak() mode.
>
>> I guess his program is waiting for a return which you don't get when you
>> just press a function key.
>>
>> As he is a gnome2 fan boy,
>
> Jump to fewer conclusions.  If I were a gnome2 fanboy I'd be using
> something like GTK+
>
>> he may need to disable the hot key F1 (if
>> it's possible in gnome2, as mr Havoc was so kind and thought the less
>> configuration options the less confused would the users be, so you can't
>> do half of the stuff you could do in Miguel de Icaza's Gnome).
>
> Indeed, in the Linux newsgroups people "like you" don't even know "if
> it's possible in gnome2".

People know better than in a PHP newsgroup.

How many correct answers have you gotten so far?

But then we've been this route before, and you've been too lazy to try 
to find an appropriate newsgroup then, either.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#6690

Fromcrankypuss <no@email.thanks>
Date2012-07-30 05:08 -0600
Message-ID<jv5q0a12t86@news4.newsguy.com>
In reply to#6687
On 07/29/2012 07:13 PM, Jerry Stuckle wrote:
> On 7/29/2012 5:54 AM, crankypuss wrote:
>> On 07/28/2012 07:21 AM, J.O. Aho wrote:
>>> Jerry Stuckle wrote:
>>>> On 7/28/2012 7:50 AM, crankypuss wrote:
>>>>> On 07/28/2012 05:45 AM, dickey@his.com wrote:
>>>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>>>>> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>>>>>>>
>>>>>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>>>>
>>>>>>>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>>>>>>>> TRUE)&quot;
>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>>> What is the equivalent using the PHP interface to ncurses?
>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>>>> Pressing F1 just brings up gnome help (running in xterm under
>>>>>>>>> ubuntu 11.10).
>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>> that sounds as if you're using one of the vte-based hacks such as
>>>>>>>> gnome-terminal,
>>>>>>>
>>>>>>>> which hijack some keys - have to fix that by undoing the item in
>>>>>>>> their respective
>>>>>>>
>>>>>>>> setup dialogs.
>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I'm using "xterm" and also on a cli (non-GUI) login... terminal
>>>>>>> type is
>>>>>>>
>>>>>>> either "xterm" or "linux". Less stuff grabbed as Linux console.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Any additional pointers/keywords I can use to find out more about
>>>>>>>
>>>>>>> "undoing the item"?
>>>>>>
>>>>>> On a non-GUI login, I wouldn't expect a help-menu (puzzled there).
>>>>>> For xterm in a desktop, I suppose it's possible for the
>>>>>> window-manager
>>>>>> to have F1 bound (Mac OS X's settings do this with some of the
>>>>>> function keys, though I've disabled most of those...).
>>>>>>
>>>>>
>>>>> On the non-GUI login the F1 key is readily available.
>>>>>
>>>>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>>>>>
>>>>> Can you offer any information about how to modify this on Linux? I'm
>>>>> relatively new to Linux and don't know where that is controlled.
>>>>
>>>> Try a Linux newsgroup.
>>>
>>> Quite bored of crankys posts, so I hope he will not.
>>
>> That goes both ways.
>>
>>> I suggest he would
>>> read documentation for once, if he had done that he may have read the
>>> following:
>>>
>>> Quoted from the ncurses_programming_howto:
>>
>> You quote the C-language interface documentation.  Take a look at the
>> close-to-nonexistent documentation for the PHP interface sometime.
>>
>>> Normally the terminal driver buffers the characters a user types until a
>>> new line or carriage return is encountered. But most programs require
>>> that the characters be available as soon as the user types them. The
>>> above two functions are used to disable line buffering. The difference
>>> between these two functions is in the way control characters like
>>> suspend (CTRL-Z), interrupt and quit (CTRL-C) are passed to the program.
>>> In the raw() mode these characters are directly passed to the program
>>> without generating a signal. In the cbreak() mode these control
>>> characters are interpreted as any other character by the terminal
>>> driver.
>>
>> The code is running in cbreak() mode.
>>
>>> I guess his program is waiting for a return which you don't get when you
>>> just press a function key.
>>>
>>> As he is a gnome2 fan boy,
>>
>> Jump to fewer conclusions.  If I were a gnome2 fanboy I'd be using
>> something like GTK+
>>
>>> he may need to disable the hot key F1 (if
>>> it's possible in gnome2, as mr Havoc was so kind and thought the less
>>> configuration options the less confused would the users be, so you can't
>>> do half of the stuff you could do in Miguel de Icaza's Gnome).
>>
>> Indeed, in the Linux newsgroups people "like you" don't even know "if
>> it's possible in gnome2".
>
> People know better than in a PHP newsgroup.
>
> How many correct answers have you gotten so far?
>
> But then we've been this route before, and you've been too lazy to try
> to find an appropriate newsgroup then, either.

I'm all ears Jerry, what is the most appropriate newsgroup of questions 
about the PHP interface to ncurses?

[toc] | [prev] | [next] | [standalone]


#6691

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2012-07-30 07:09 -0500
Message-ID<slrnk1cucb.h39.hellsop@nibelheim.ninehells.com>
In reply to#6690
On Mon, 30 Jul 2012 05:08:57 -0600, crankypuss wrote:
> On 07/29/2012 07:13 PM, Jerry Stuckle wrote:
>> On 7/29/2012 5:54 AM, crankypuss wrote:
>>> Indeed, in the Linux newsgroups people "like you" don't even know "if
>>> it's possible in gnome2".
>>
>> People know better than in a PHP newsgroup.
>>
>> How many correct answers have you gotten so far?
>>
>> But then we've been this route before, and you've been too lazy to try
>> to find an appropriate newsgroup then, either.
>
> I'm all ears Jerry, what is the most appropriate newsgroup of questions 
> about the PHP interface to ncurses?

I humbly suggest that Jerry might have been refering to more appropriate
places to ask how to turn off gnome's interception of the F1 keystroke.
If gnome help comes up, the F1 is gone, and there's no point in even
ASKING about how to detect it in a terminal if it's never there to even
check for.

-- 
31. All naive, busty tavern wenches in my realm will be replaced with 
   surly, world-weary waitresses who will provide no unexpected 
   reinforcement and/or romantic subplot for the hero or his sidekick.
        --Peter Anspach's list of things to do as an Evil Overlord

[toc] | [prev] | [next] | [standalone]


#6692

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-07-30 10:39 -0400
Message-ID<jv66ad$slr$1@dont-email.me>
In reply to#6691
On 7/30/2012 8:09 AM, Peter H. Coffin wrote:
> On Mon, 30 Jul 2012 05:08:57 -0600, crankypuss wrote:
>> On 07/29/2012 07:13 PM, Jerry Stuckle wrote:
>>> On 7/29/2012 5:54 AM, crankypuss wrote:
>>>> Indeed, in the Linux newsgroups people "like you" don't even know "if
>>>> it's possible in gnome2".
>>>
>>> People know better than in a PHP newsgroup.
>>>
>>> How many correct answers have you gotten so far?
>>>
>>> But then we've been this route before, and you've been too lazy to try
>>> to find an appropriate newsgroup then, either.
>>
>> I'm all ears Jerry, what is the most appropriate newsgroup of questions
>> about the PHP interface to ncurses?
>
> I humbly suggest that Jerry might have been refering to more appropriate
> places to ask how to turn off gnome's interception of the F1 keystroke.
> If gnome help comes up, the F1 is gone, and there's no point in even
> ASKING about how to detect it in a terminal if it's never there to even
> check for.
>

Eggzactly!


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#6694

Fromlegalize+jeeves@mail.xmission.com (Richard)
Date2012-07-30 18:53 +0000
Message-ID<jv6l7u$4at$2@news.xmission.com>
In reply to#6681
[Please do not mail me a copy of your followup]

crankypuss <no@email.thanks> spake the secret code
<jv0jmp12jel@news7.newsguy.com> thusly:

>On the non-GUI login the F1 key is readily available.
>
>Other keys, like ctl-C and ctl-alt-D are firmly bound.

If you're using curses, you need to put the terminal in 'cbreak' mode.
From the man pages:

	"The cbreak routine disables  line  buffering and erase/kill
	character-processing (interrupt and flow control characters are
	unaffected), making characters typed by the user immediately available
	to the program.  The nocbreak routine returns the terminal to normal
	(cooked) mode."

-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

[toc] | [prev] | [next] | [standalone]


#6696

Fromcrankypuss <no@email.thanks>
Date2012-07-31 04:43 -0600
Message-ID<jv8ctg01e3r@news6.newsguy.com>
In reply to#6694
On 07/30/2012 12:53 PM, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> crankypuss <no@email.thanks> spake the secret code
> <jv0jmp12jel@news7.newsguy.com> thusly:
>
>> On the non-GUI login the F1 key is readily available.
>>
>> Other keys, like ctl-C and ctl-alt-D are firmly bound.
>
> If you're using curses, you need to put the terminal in 'cbreak' mode.
>  From the man pages:
>
> 	"The cbreak routine disables  line  buffering and erase/kill
> 	character-processing (interrupt and flow control characters are
> 	unaffected), making characters typed by the user immediately available
> 	to the program.  The nocbreak routine returns the terminal to normal
> 	(cooked) mode."

I've been using cbreak mode since day-1 or at least day-1.5

It seems clear at this point that layers running "below" ncurses are 
limiting its usefulness by taking over certain keys for their cutsie 
menus and so forth.  I had hoped that there was some even-lower-level 
Linux system facility that nurses could use to get some control back but 
apparently not, apparently I'll need to go on some quest to find out who 
the heck "owns" the terminal and see how things can be dealt with more 
usefully.

I might need to entirely abandon ncurses as useless for my purposes and 
work through the fugliness of html since at least browsers serve up a 
level of cross-system consistency.  But I really don't want to give up 
the key-by-key responsiveness that ncurses in cbreak mode provides, and 
I really don't want to deal with the security issues of having a local 
apache server involved in a lower-level utility's interface.

Thanks to all those who attempted to help.

[toc] | [prev] | [next] | [standalone]


#6697

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2012-07-31 08:03 -0500
Message-ID<slrnk1fltf.h39.hellsop@nibelheim.ninehells.com>
In reply to#6696
On Tue, 31 Jul 2012 04:43:59 -0600, crankypuss wrote:
> It seems clear at this point that layers running "below" ncurses are 
> limiting its usefulness by taking over certain keys for their cutsie 
> menus and so forth.  I had hoped that there was some even-lower-level 
> Linux system facility that nurses could use to get some control back but 
> apparently not, apparently I'll need to go on some quest to find out who 
> the heck "owns" the terminal and see how things can be dealt with more 
> usefully.
>
> I might need to entirely abandon ncurses as useless for my purposes and 
> work through the fugliness of html since at least browsers serve up a 
> level of cross-system consistency.  But I really don't want to give up 
> the key-by-key responsiveness that ncurses in cbreak mode provides, and 
> I really don't want to deal with the security issues of having a local 
> apache server involved in a lower-level utility's interface.

Kinda makes one miss the days when Runlevel 3 MEANT something, doesn't
it?

-- 
11. I will be secure in my superiority. Therefore, I will feel no need
   to prove it by leaving clues in the form of riddles or leaving my 
   weaker enemies alive to show they pose no threat.
        --Peter Anspach's list of things to do as an Evil Overlord

[toc] | [prev] | [next] | [standalone]


#6701

FromNorman Peelman <npeelmandog@cfl.rr.com>
Date2012-07-31 22:08 -0400
Message-ID<jva33r$fdf$1@dont-email.me>
In reply to#6676
On 07/27/2012 12:29 PM, crankypuss wrote:
> On 07/27/2012 05:00 AM, dickey@his.com wrote:
>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>> Using the C interface the incantation is &quot;keypad(stdscr,
>>> TRUE)&quot;
>>>
>>> What is the equivalent using the PHP interface to ncurses?
>>>
>>> Pressing F1 just brings up gnome help (running in xterm under ubuntu
>>> 11.10).
>>
>> that sounds as if you're using one of the vte-based hacks such as
>> gnome-terminal,
>> which hijack some keys - have to fix that by undoing the item in their
>> respective
>> setup dialogs.
>>
>
> I'm using "xterm" and also on a cli (non-GUI) login... terminal type is
> either "xterm" or "linux". Less stuff grabbed as Linux console.
>
> Any additional pointers/keywords I can use to find out more about
> "undoing the item"?
>
> Thanks.

   You can turn off the shortcuts by going to:
Edit->Keyboard Shortcuts

...scroll down to Help->Contents and double-click the 'F1' entry and 
press 'Backspace' to disable it. Can this be done programmatic-ally? I 
don't know. As an aside if I remember correctly what little I've done in 
(php)ncurses when checking for those 'special' keys, they return a 
multi-byte sequence... so based on the first result you may need to do 
another getchar (or whatever it's called) as well. I do believe the 
arrow keys and F# keys meet this requirement.

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.php


csiph-web