All of lore.kernel.org
 help / color / mirror / Atom feed
* GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
@ 2008-08-23 10:16 Carles Pina i Estany
  2008-08-23 10:34 ` Vesa Jääskeläinen
  0 siblings, 1 reply; 6+ messages in thread
From: Carles Pina i Estany @ 2008-08-23 10:16 UTC (permalink / raw)
  To: grub-devel


Hello,

I started to play with GRUB_TERM_PPAGE/NPAGE in normal/menu.c and I've
had a problem: they was working in opposite way than I've expected.

Tracing the problem deeper than swapping GRUB_TERM_PPAGE constant by
GRUB_TERM_NPAGE, I have found that this values comes from
GRUB_CONSOLE_KEY_NPAGE.

Let's define: NPAGE (next page) = PGDN (PG DOWN). PPAGE (previous page)
= PGUP (PG UP).  Is this assumption correct?

There is quite much places in Grub2 code that defines:
#define GRUB_CONSOLE_KEY_NPAGE          0x4900
#define GRUB_CONSOLE_KEY_PPAGE          0x5100

Googling for these codes, I've found that they are usually defined in
opposite way:
#define 	KEY_PGUP   0x4900
#define 	KEY_PGDN   0x5100

All other codes matches.

If this is correct, a bit later I will prepare a patch to swap 0x4900
and 0x5100 where it's needed.

Am I missing something?

Thanks,

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
  2008-08-23 10:16 GRUB_CONSOLE_KEY_NPAGE/PPAGE codes Carles Pina i Estany
@ 2008-08-23 10:34 ` Vesa Jääskeläinen
  2008-08-23 13:03   ` Carles Pina i Estany
  2008-08-24 12:33   ` Carles Pina i Estany
  0 siblings, 2 replies; 6+ messages in thread
From: Vesa Jääskeläinen @ 2008-08-23 10:34 UTC (permalink / raw)
  To: The development of GRUB 2

Carles Pina i Estany wrote:
> Hello,
> 
> I started to play with GRUB_TERM_PPAGE/NPAGE in normal/menu.c and I've
> had a problem: they was working in opposite way than I've expected.
> 
> Tracing the problem deeper than swapping GRUB_TERM_PPAGE constant by
> GRUB_TERM_NPAGE, I have found that this values comes from
> GRUB_CONSOLE_KEY_NPAGE.
> 
> Let's define: NPAGE (next page) = PGDN (PG DOWN). PPAGE (previous page)
> = PGUP (PG UP).  Is this assumption correct?
> 
> There is quite much places in Grub2 code that defines:
> #define GRUB_CONSOLE_KEY_NPAGE          0x4900
> #define GRUB_CONSOLE_KEY_PPAGE          0x5100
> 
> Googling for these codes, I've found that they are usually defined in
> opposite way:
> #define 	KEY_PGUP   0x4900
> #define 	KEY_PGDN   0x5100
> 
> All other codes matches.
> 
> If this is correct, a bit later I will prepare a patch to swap 0x4900
> and 0x5100 where it's needed.
> 
> Am I missing something?

Or me..  couldn't we just use GRUB_CONSOLE_KEY_PAGE_UP /
GRUB_CONSOLE_KEY_PAGE_DOWN or something like that. NPAGE or PPAGE seems
a bit weird. Then there is no need to hassle this next time when the
issue is at hand :)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
  2008-08-23 10:34 ` Vesa Jääskeläinen
@ 2008-08-23 13:03   ` Carles Pina i Estany
  2008-08-24 12:33   ` Carles Pina i Estany
  1 sibling, 0 replies; 6+ messages in thread
From: Carles Pina i Estany @ 2008-08-23 13:03 UTC (permalink / raw)
  To: The development of GRUB 2


Hi,

On Aug/23/2008, Vesa Jääskeläinen wrote:

> > Let's define: NPAGE (next page) = PGDN (PG DOWN). PPAGE (previous page)
> > = PGUP (PG UP).  Is this assumption correct?
> > 
> > There is quite much places in Grub2 code that defines:
> > #define GRUB_CONSOLE_KEY_NPAGE          0x4900
> > #define GRUB_CONSOLE_KEY_PPAGE          0x5100
> > 
> > Googling for these codes, I've found that they are usually defined in
> > opposite way:
> > #define 	KEY_PGUP   0x4900
> > #define 	KEY_PGDN   0x5100
> > 
> > All other codes matches.

checking the Grub's ChangeLog (not Grub2):
------
2003-03-19  Yoshinori K. Okuji  <okuji@enbug.org>

        From Adam Lackorzynski <adam@os.inf.tu-dresden.de>:
        * stage2/shared.h (KEY_NPAGE): Changed to 0x5100.
        (KEY_PPAGE): Changed to 0x4900.
------
It defines PPAGE as 0x4900 and NPAGE as 0x5100. This is the change that I also
want to do, so looks fine.

> > If this is correct, a bit later I will prepare a patch to swap 0x4900
> > and 0x5100 where it's needed.
> > 
> > Am I missing something?
> 
> Or me..  couldn't we just use GRUB_CONSOLE_KEY_PAGE_UP /
> GRUB_CONSOLE_KEY_PAGE_DOWN or something like that. NPAGE or PPAGE seems
> a bit weird. Then there is no need to hassle this next time when the
> issue is at hand :)

Then I would also change GRUB_TERM_PPAGE and GRUB_TERM_NPAGE names to
GRUB_TERM_PAGE_UP and GRUB_TERM_PAGE_DOWN (from include/grub/term.h, to be
consistent between GRUB_TERM_ and GRUB_CONSOLE_). And the places in the code
that this appears.

Note: in Spanish Page Up key is "RePag" that it means something like
"Previous Page". So maybe who wrote these names in first instance is not
English speaker and in his/her language it's called "Previous Page" and not
"Page Up". Here I'm just guessing.

So:
a) the values are swapped. I will send a patch to swap GRUB_CONSOLE_KEY_NPAGE
and GRUB_CONSOLE_KEY_PPAGE in all places.

b) what you (people in general) think about changing the name from
GRUB_CONSOLE_KEY_NPAGE to GRUB_CONSOLE_KEY_PAGE_DOWN? (and PAGE_UP) and also
the GRUB_TERM_? If we want to change, do you prefer that I change it in the same patch or different patch than changing the values?

Thanks for your helping,

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
  2008-08-23 10:34 ` Vesa Jääskeläinen
  2008-08-23 13:03   ` Carles Pina i Estany
@ 2008-08-24 12:33   ` Carles Pina i Estany
  2008-08-24 16:08     ` Vesa Jääskeläinen
  1 sibling, 1 reply; 6+ messages in thread
From: Carles Pina i Estany @ 2008-08-24 12:33 UTC (permalink / raw)
  To: The development of GRUB 2


Hello,

On Aug/23/2008, Vesa Jääskeläinen wrote:

> > Let's define: NPAGE (next page) = PGDN (PG DOWN). PPAGE (previous page)
> > = PGUP (PG UP).  Is this assumption correct?

[...]

> Or me..  couldn't we just use GRUB_CONSOLE_KEY_PAGE_UP /
> GRUB_CONSOLE_KEY_PAGE_DOWN or something like that. NPAGE or PPAGE seems
> a bit weird. Then there is no need to hassle this next time when the
> issue is at hand :)

It seems that in Grub there is always some reason for the things :-)

In the ChangeLog from Grub (not Grub2) I can read:
--------
1999-03-13  Gordon Matzigkeit  <gord@trick.fig.org>

[...]

        * shared_src/shared.h (KEY_DELETE): Rename to KEY_DC, for
        compatibility with curses.
        (KEY_INSERT): Rename to KEY_IC.
        (KEY_PGDN): Rename to KEY_NPAGE.
        (KEY_PGUP): Rename to KEY_PPAGE.
--------

These names are still valid in libncurses5.

So, by the moment, I will send a patch for only changing the values.

Cheers,

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
  2008-08-24 12:33   ` Carles Pina i Estany
@ 2008-08-24 16:08     ` Vesa Jääskeläinen
  2008-08-30 11:25       ` Robert Millan
  0 siblings, 1 reply; 6+ messages in thread
From: Vesa Jääskeläinen @ 2008-08-24 16:08 UTC (permalink / raw)
  To: The development of GRUB 2

Carles Pina i Estany wrote:
> In the ChangeLog from Grub (not Grub2) I can read:
> --------
> 1999-03-13  Gordon Matzigkeit  <gord@trick.fig.org>
> 
> [...]
> 
>         * shared_src/shared.h (KEY_DELETE): Rename to KEY_DC, for
>         compatibility with curses.
>         (KEY_INSERT): Rename to KEY_IC.
>         (KEY_PGDN): Rename to KEY_NPAGE.
>         (KEY_PGUP): Rename to KEY_PPAGE.
> --------
> 
> These names are still valid in libncurses5.

wtf?!

What idiocy is this ?? Making it really hard for normal people to
understand what those means. I would go for understandability and not to
be "compatible" with curses internally... curses terminal driver can use
what ever it wants.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: GRUB_CONSOLE_KEY_NPAGE/PPAGE codes
  2008-08-24 16:08     ` Vesa Jääskeläinen
@ 2008-08-30 11:25       ` Robert Millan
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Millan @ 2008-08-30 11:25 UTC (permalink / raw)
  To: The development of GRUB 2

On Sun, Aug 24, 2008 at 07:08:00PM +0300, Vesa Jääskeläinen wrote:
> Carles Pina i Estany wrote:
> > In the ChangeLog from Grub (not Grub2) I can read:
> > --------
> > 1999-03-13  Gordon Matzigkeit  <gord@trick.fig.org>
> > 
> > [...]
> > 
> >         * shared_src/shared.h (KEY_DELETE): Rename to KEY_DC, for
> >         compatibility with curses.
> >         (KEY_INSERT): Rename to KEY_IC.
> >         (KEY_PGDN): Rename to KEY_NPAGE.
> >         (KEY_PGUP): Rename to KEY_PPAGE.
> > --------
> > 
> > These names are still valid in libncurses5.
> 
> wtf?!
> 
> What idiocy is this ??

Calm down!  Or you'll scare him :-)

> Making it really hard for normal people to
> understand what those means. I would go for understandability and not to
> be "compatible" with curses internally... curses terminal driver can use
> what ever it wants.

Agreed.  If we want to be compatible with curses code, we could just add a
layer.  Or even define macro aliases (e.g. #define KEY_IC KEY_INSERT).

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-30 11:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-23 10:16 GRUB_CONSOLE_KEY_NPAGE/PPAGE codes Carles Pina i Estany
2008-08-23 10:34 ` Vesa Jääskeläinen
2008-08-23 13:03   ` Carles Pina i Estany
2008-08-24 12:33   ` Carles Pina i Estany
2008-08-24 16:08     ` Vesa Jääskeläinen
2008-08-30 11:25       ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.