Make insert and ctrl-v behavior the opposite.

* ctrl-v clipboard ctrl-shift-v primary
        * insert primary shift-insert clipboard.
This commit is contained in:
QC 2014-08-02 23:08:14 +02:00
parent 7046656246
commit 0e12051783
2 changed files with 14 additions and 9 deletions

View File

@ -1364,8 +1364,12 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
KeySym key = XkbKeycodeToKeysym ( display, ev.xkey.keycode, 0, 0 );
if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ||
key == XK_Insert ) {
if ( ( ( ( ev.xkey.state & ControlMask ) == ControlMask ) && key == XK_v ) ) {
XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ?
XA_PRIMARY : netatoms[CLIPBOARD],
netatoms[UTF8_STRING], netatoms[UTF8_STRING], main_window, CurrentTime );
}
if ( key == XK_Insert ) {
XConvertSelection ( display, ( ev.xkey.state & ShiftMask ) ?
netatoms[CLIPBOARD] : XA_PRIMARY,
netatoms[UTF8_STRING], netatoms[UTF8_STRING], main_window, CurrentTime );

View File

@ -178,9 +178,10 @@ void textbox_moveresize ( textbox *tb, int x, int y, int w, int h )
}
else {
// set ellipsize
if( (tb->flags & TB_EDITABLE) == TB_EDITABLE ) {
if ( ( tb->flags & TB_EDITABLE ) == TB_EDITABLE ) {
pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_MIDDLE );
}else{
}
else{
pango_layout_set_ellipsize ( tb->layout, PANGO_ELLIPSIZE_END );
}
}
@ -257,18 +258,18 @@ void textbox_draw ( textbox *tb )
pango_layout_set_width ( tb->layout, PANGO_SCALE * ( tb->w - 2 * SIDE_MARGIN ) );
int x = PANGO_SCALE*SIDE_MARGIN, y = 0;
int x = PANGO_SCALE * SIDE_MARGIN, y = 0;
if ( tb->flags & TB_RIGHT ) {
x = (tb->w - line_width)*PANGO_SCALE;
x = ( tb->w - line_width ) * PANGO_SCALE;
}
else if ( tb->flags & TB_CENTER ) {
x = (PANGO_SCALE*( tb->w - line_width )) / 2;
x = ( PANGO_SCALE * ( tb->w - line_width ) ) / 2;
}
y = (PANGO_SCALE*(textbox_get_width(tb) - textbox_get_font_width(tb)))/2;
y = ( PANGO_SCALE * ( textbox_get_width ( tb ) - textbox_get_font_width ( tb ) ) ) / 2;
// Render the layout.
pango_xft_render_layout ( draw, &( tb->color_fg ), tb->layout,
x , y );
x, y );
// draw the cursor
if ( tb->flags & TB_EDITABLE ) {