[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] funktionstaster under Ncurses



Kristian Nørgaard wrote:

Jeg kigger på et NCurses program jeg ikke selv har lavet.
Tastetryk identificeres udfra noget a la
--------------------------------
switch (ch) {
    case KEY_F(1): ... do something ...; break;
    case KEY_LEFT: ... do something ...; break;
    case 'r': ... do something ...; break;
    default: ... do something ...; break;
}
---------------------------------
Hvor er disse KEY_F(1) og KEY_LEFT defineret?

Et eller andet sted i ncurses.h, jeg kan fortælle dig at en piltast er sammensat af end én karakter:


\27 (ESC) + [ + A (pil op så vidt jeg husker)

Hvordan identificerer jeg f.eks. tastekombinationerne:

ALT-k

Meta defineres ikke ud fra ESC så vidt jeg husker, her er definitionenerne


# define K_ALTA		0x61
# define K_ALTB		0x62
# define K_ALTC		0x63
# define K_ALTD		0x64
# define K_ALTE		0x65
# define K_ALTF		0x66
# define K_ALTG		0x67
# define K_ALTH		0x68
# define K_ALTI		0x69
# define K_ALTJ		0x6a
# define K_ALTK		0x6b
# define K_ALTL		0x6c
# define K_ALTM		0x6d
# define K_ALTN		0x6e
# define K_ALTO		0x6f
# define K_ALTP		0x70
# define K_ALTQ		0x71
# define K_ALTR		0x72
# define K_ALTS		0x73
# define K_ALTT		0x74
# define K_ALTU		0x75
# define K_ALTV		0x76
# define K_ALTW		0x77
# define K_ALTX		0x78
# define K_ALTY		0x79
# define K_ALTZ		0x7a


ALT-F12

Dunno


SHIFT-F12

# define K_SF1 '!' # define K_SF2 '@' # define K_SF3 '#' # define K_SF4 '$' # define K_SF5 '%' # define K_SF6 '^' # define K_SF7 '&' # define K_SF8 '*' # define K_SF9 '(' # define K_SF10 ')' # define K_SF11 '_' # define K_SF12 '+'

Kilde:
http://cvs.sourceforge.net/viewcvs.py/maximus/maximus/slib/keys.h?rev=1.5&view=markup

Bo

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *