FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » ncurses on Linux how to capture F1 key?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
ncurses on Linux how to capture F1 key? [message #178744] Fri, 27 July 2012 10:42 Go to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
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).
Re: ncurses on Linux how to capture F1 key? [message #178745 is a reply to message #178744] Fri, 27 July 2012 11:00 Go to previous messageGo to next message
dickey is currently offline  dickey
Messages: 2
Registered: July 2012
Karma: 0
Junior Member
On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
> 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).

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.
Re: ncurses on Linux how to capture F1 key? [message #178749 is a reply to message #178745] Fri, 27 July 2012 16:29 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>> 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).
>
> 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.
Re: ncurses on Linux how to capture F1 key? [message #178753 is a reply to message #178749] Sat, 28 July 2012 11:45 Go to previous messageGo to next message
dickey is currently offline  dickey
Messages: 2
Registered: July 2012
Karma: 0
Junior Member
On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>
>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>
>>> 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).
>
>>
>
>> 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...).
Re: ncurses on Linux how to capture F1 key? [message #178754 is a reply to message #178753] Sat, 28 July 2012 11:50 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 07/28/2012 05:45 AM, dickey(at)his(dot)com wrote:
> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>
>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>
>>>> 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).
>>
>>>
>>
>>> 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.
Re: ncurses on Linux how to capture F1 key? [message #178755 is a reply to message #178754] Sat, 28 July 2012 12:39 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 7/28/2012 7:50 AM, crankypuss wrote:
> On 07/28/2012 05:45 AM, dickey(at)his(dot)com wrote:
>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>
>>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>
>>>> > 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).
>>>
>>>>
>>>
>>>> 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(at)attglobal(dot)net
==================
Re: ncurses on Linux how to capture F1 key? [message #178756 is a reply to message #178755] Sat, 28 July 2012 13:21 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
Jerry Stuckle wrote:
> On 7/28/2012 7:50 AM, crankypuss wrote:
>> On 07/28/2012 05:45 AM, dickey(at)his(dot)com wrote:
>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>>
>>>> > On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>>
>>>> >> 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).
>>>>
>>>> >
>>>>
>>>> > 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
Re: ncurses on Linux how to capture F1 key? [message #178757 is a reply to message #178756] Sat, 28 July 2012 14:15 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)his(dot)com wrote:
>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> > On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>> >
>>>> >> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>> >
>>>> >>> 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).
>>>> >
>>>> >>
>>>> >
>>>> >> 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(at)attglobal(dot)net
==================
Re: ncurses on Linux how to capture F1 key? [message #178758 is a reply to message #178756] Sun, 29 July 2012 09:54 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
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(at)his(dot)com wrote:
>>>> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> > On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>> >
>>>> >> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>> >
>>>> >>> 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).
>>>> >
>>>> >>
>>>> >
>>>> >> 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".
Re: ncurses on Linux how to capture F1 key? [message #178759 is a reply to message #178758] Sun, 29 July 2012 11:31 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: ncurses on Linux how to capture F1 key? [message #178760 is a reply to message #178758] Mon, 30 July 2012 01:13 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)his(dot)com wrote:
>>>> > On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> >> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>> >>
>>>> >>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>> >>
>>>> >>>> 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).
>>>> >>
>>>> >>>
>>>> >>
>>>> >>> 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(at)attglobal(dot)net
==================
Re: ncurses on Linux how to capture F1 key? [message #178762 is a reply to message #178759] Mon, 30 July 2012 11:07 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
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.
Re: ncurses on Linux how to capture F1 key? [message #178763 is a reply to message #178760] Mon, 30 July 2012 11:08 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
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(at)his(dot)com wrote:
>>>> >> On Friday, July 27, 2012 12:29:53 PM UTC-4, crankypuss wrote:
>>>> >>> On 07/27/2012 05:00 AM, dickey(at)his(dot)com wrote:
>>>> >>>
>>>> >>>> On Friday, July 27, 2012 6:42:09 AM UTC-4, crankypuss wrote:
>>>> >>>
>>>> >>>>> 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).
>>>> >>>
>>>> >>>>
>>>> >>>
>>>> >>>> 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?
Re: ncurses on Linux how to capture F1 key? [message #178764 is a reply to message #178763] Mon, 30 July 2012 12:09 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
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
Re: ncurses on Linux how to capture F1 key? [message #178765 is a reply to message #178764] Mon, 30 July 2012 14:39 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: ncurses on Linux how to capture F1 key? [message #178766 is a reply to message #178762] Mon, 30 July 2012 16:27 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: ncurses on Linux how to capture F1 key? [message #178767 is a reply to message #178754] Mon, 30 July 2012 18:53 Go to previous messageGo to next message
legalize+jeeves is currently offline  legalize+jeeves
Messages: 21
Registered: September 2010
Karma: 0
Junior Member
[Please do not mail me a copy of your followup]

crankypuss <no(at)email(dot)thanks> spake the secret code
<jv0jmp12jel(at)news7(dot)newsguy(dot)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>
Re: ncurses on Linux how to capture F1 key? [message #178769 is a reply to message #178767] Tue, 31 July 2012 10:43 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 07/30/2012 12:53 PM, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> crankypuss <no(at)email(dot)thanks> spake the secret code
> <jv0jmp12jel(at)news7(dot)newsguy(dot)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.
Re: ncurses on Linux how to capture F1 key? [message #178770 is a reply to message #178769] Tue, 31 July 2012 13:03 Go to previous messageGo to next message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma: 0
Senior Member
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
Re: ncurses on Linux how to capture F1 key? [message #178774 is a reply to message #178749] Wed, 01 August 2012 02:08 Go to previous messageGo to next message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma: 0
Senior Member
On 07/27/2012 12:29 PM, crankypuss wrote:
> On 07/27/2012 05:00 AM, dickey(at)his(dot)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?-
Re: ncurses on Linux how to capture F1 key? [message #178778 is a reply to message #178774] Wed, 01 August 2012 08:43 Go to previous messageGo to next message
crankypuss is currently offline  crankypuss
Messages: 147
Registered: March 2011
Karma: 0
Senior Member
On 07/31/2012 08:08 PM, Norman Peelman wrote:
> On 07/27/2012 12:29 PM, crankypuss wrote:
>> On 07/27/2012 05:00 AM, dickey(at)his(dot)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.

I don't want to turn my Linux installation into a mutant, I just want to
be able to run a mutant program on it.

> 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.

Some do, some don't. Trying to support every known obsolete terminal
does kind of kick the ability to use current physical console hardware
in the crotch. I foresee much reading of C-language source code and
much swearing prior to throwing up my hands and rewriting
who-knows-what, and I'm not liking that nightmare, done it too many
times before.
Re: ncurses on Linux how to capture F1 key? [message #178779 is a reply to message #178778] Wed, 01 August 2012 11:34 Go to previous message
Norman Peelman is currently offline  Norman Peelman
Messages: 126
Registered: September 2010
Karma: 0
Senior Member
On 08/01/2012 04:43 AM, crankypuss wrote:
> On 07/31/2012 08:08 PM, Norman Peelman wrote:
>> On 07/27/2012 12:29 PM, crankypuss wrote:
>>> On 07/27/2012 05:00 AM, dickey(at)his(dot)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.
>
> I don't want to turn my Linux installation into a mutant, I just want to
> be able to run a mutant program on it.
>
>> 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.
>
> Some do, some don't. Trying to support every known obsolete terminal
> does kind of kick the ability to use current physical console hardware
> in the crotch. I foresee much reading of C-language source code and much
> swearing prior to throwing up my hands and rewriting who-knows-what, and
> I'm not liking that nightmare, done it too many times before.

Aha! This setting can be found in the GConf editor (registry):

Apps->gnome-terminal->keybindings

Setting to 'disabled' turned it off. This disabled F1 for all
'gnome-terminal's that I opened after changing the setting. The setting
is applied -on-the-fly- and is immediately reflected in (all) open
gnome-terminals.

You can script (php->exec/system) this, take a look:

http://commons.oreilly.com/wiki/index.php/Ubuntu_Hacks/The_Linux_Desktop
http://commons.oreilly.com/wiki/index.php/Ubuntu_Hacks/The_Linux_Desktop#Sc ripting_GConf
http://webnesbay.com/configure-your-gnome-desktop-environment-using-gconfto ol-in-ubuntu-linux/

That should do what you want... as for the actual grabbing of the
keys, I don't have (php)ncurses set up on this machine (or one that's
handy at the moment) to try.

There are some user notes here you may be interested in:

http://www.php.net/manual/en/function.ncurses-getch.php




--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: strip_tags function
Next Topic: Is my array understanding correct?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 06:48:08 GMT 2024

Total time taken to generate the page: 0.02421 seconds