Insert key paste secondary, shift-insert primary.

This commit is contained in:
QC 2014-06-02 13:29:43 +02:00
parent 92db68b36d
commit 6fb7e345d0
4 changed files with 12 additions and 11 deletions

View File

@ -81,7 +81,7 @@ typedef int ( *menu_match_cb )( char **tokens, const char *input, int index, voi
MenuReturn menu ( char **lines, char **input, char *prompt, MenuReturn menu ( char **lines, char **input, char *prompt,
Time *time, int *shift, Time *time, int *shift,
menu_match_cb mmc, void *mmc_data, menu_match_cb mmc, void *mmc_data,
int *selected_line ) __attribute__ ((nonnull(1,2,3,8))); int *selected_line ) __attribute__ ( ( nonnull ( 1, 2, 3, 8 ) ) );
void catch_exit ( __attribute__( ( unused ) ) int sig ); void catch_exit ( __attribute__( ( unused ) ) int sig );

View File

@ -19,12 +19,12 @@ typedef struct
typedef enum typedef enum
{ {
TB_AUTOHEIGHT = 1 << 0, TB_AUTOHEIGHT = 1 << 0,
TB_AUTOWIDTH = 1 << 1, TB_AUTOWIDTH = 1 << 1,
TB_LEFT = 1 << 16, TB_LEFT = 1 << 16,
TB_RIGHT = 1 << 17, TB_RIGHT = 1 << 17,
TB_CENTER = 1 << 18, TB_CENTER = 1 << 18,
TB_EDITABLE = 1 << 19, TB_EDITABLE = 1 << 19,
} TextboxFlags; } TextboxFlags;
typedef enum typedef enum

View File

@ -1338,7 +1338,8 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi
KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 ); KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 );
if ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ||
key == XK_Insert )
{ {
// TODO move these. // TODO move these.
Atom clip = XInternAtom ( display, "CLIPBOARD", False ); Atom clip = XInternAtom ( display, "CLIPBOARD", False );

View File

@ -239,8 +239,8 @@ void textbox_draw ( textbox *tb )
// Trailing spaces still go wrong.... // Trailing spaces still go wrong....
// The replace by _ is needed, one way or the other. // The replace by _ is needed, one way or the other.
// Make a copy, and replace all trailing spaces. // Make a copy, and replace all trailing spaces.
char *test = strdup(text); char *test = strdup ( text );
for(int iter = strlen(text)-1; iter >= 0 && test[iter] == ' '; iter--) for ( int iter = strlen ( text ) - 1; iter >= 0 && test[iter] == ' '; iter-- )
{ {
test[iter] = '_'; test[iter] = '_';
} }
@ -248,7 +248,7 @@ void textbox_draw ( textbox *tb )
XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) test, cursor_offset, &extents ); XftTextExtentsUtf8 ( display, tb->font, ( unsigned char * ) test, cursor_offset, &extents );
// Add a small 4px offset between cursor and last glyph. // Add a small 4px offset between cursor and last glyph.
cursor_x = extents.width + ( ( extents.width > 0 ) ? 2 : 0 ); cursor_x = extents.width + ( ( extents.width > 0 ) ? 2 : 0 );
free(test); free ( test );
} }
// calc full input text width // calc full input text width