[2010-02-23 14:38] Sean Whitton <s...@silentflame.com>
> On Tue, Feb 23, 2010 at 02:19:10PM +0000, Sean Whitton wrote:
> > Thanks for that.  I've cleaned up the patch to be sure it works with
> > 0.3, and I've removed all the other things - anyone who is interested
> > will find it attached.
> 
> This patch has broken my zoom and scrolling keys; now j and k just zoom,
> and nothing scrolls.

This might be caused by your settings in config.h . Of course one
needs to adjust the keymappings too.

I attach my config.h to show a possible key setup. Be aware it is for
an outdated version of surf.


meillo
/* modifier 0 means no modifier */
static char *useragent      = "Mozilla/5.0 (X11; U; Linux; en-us) AppleWebKit/531.2+ (KHTML, like Gecko, surf-"VERSION") Safari/531.2+";
static char *progress       = "#000000";
static char *progress_trust = "#00FF00";
static char *stylefile      = ".surf/style.css";
static char *scriptfile     = ".surf/script.js";
static char *cookiefile     = ".surf/cookies.txt";
static char *dldir          = ".surf/dl";
static time_t sessiontime   = 3600;


char* cmd_seturi[] = { "/bin/sh", "-c",
    "xprop -id $1 -f $0 8s -set $0 `echo -n \\`xprop -id $1"
        "| awk '/^_SURF_URI/{print substr($NF, 2, length($NF)-2)}'\\`"
        "| dmenu -l 2 || exit 0`",
    "_SURF_URI", winid, NULL
};

#define SETPROP(p)       { .v = (char *[]){ "/bin/sh", "-c", \
	"xprop -id $1 -f $0 8s -set $0 `echo -n \\`xprop -id $1" \
	"| awk '/^_SURF_URI/{print substr($NF, 2, length($NF)-2)}'\\`" \
	"| dmenu -l 2 || exit 0`", \
	p, winid, NULL } }
#define MODKEY GDK_CONTROL_MASK
static Key keys[] = {
    /* modifier	            keyval      function    arg             Focus */

    { 0,               GDK_o,      spawn,      SETPROP("_SURF_URI") },
    /*{ 0,               GDK_O,      newwindow,  { .v = NULL } },*/
    { 0,               GDK_O,      newwindow,  { 0 } },

    { 0,               GDK_Escape, stop,       { 0 } },
    { 0,               GDK_i,      insert,     { .v = NULL } },

    { 0,               GDK_s,      stop,       { 0 } },
    { 0,               GDK_R,      reload,     { .b = TRUE } },
    { 0,               GDK_r,      reload,     { .b = FALSE } },

    { 0,               GDK_p,      clipboard,  { .b = TRUE } },
    { 0,               GDK_y,      clipboard,  { .b = FALSE } },

    { 0,               GDK_minus,  zoom,       { .i = -1 } },
    { 0,               GDK_plus,   zoom,       { .i = +1 } },
    { 0,               GDK_0,      zoom,       { .i = 0  } },

    { 0,               GDK_f,      navigate,   { .i = +1 } },
    { 0,               GDK_b,      navigate,   { .i = -1 } },

    { 0,               GDK_j,      scroll,     { .i = +1 } },
    { 0,               GDK_k,      scroll,     { .i = -1 } },
    { 0,               GDK_G,      scroll,     { .i = +10000 } },
    { 0,               GDK_g,      scroll,     { .i = -10000 } },
    { 0,               GDK_space,  scroll,     { .i = +100 } },

    { 0,               GDK_slash,  spawn,      SETPROP("_SURF_FIND") },
    { 0,               GDK_n,      find,       { .b = TRUE } },
    { 0,               GDK_N,      find,       { .b = FALSE } },

};

static Item items[] = {
    { "Back",           navigate,  { .i = -1 } },
    { "New Window",     newwindow, { .v = NULL } },
};
/*
    { "Reload",         reload,    { .b = FALSE } },
    { "Stop",           stop,      { 0 } },
    { "Forward",        navigate,  { .i = +1 } },
    { "Copy URI",       clipboard, { .b = FALSE } },
    { "Paste URI",      clipboard, { .b = TRUE } },
*/

Reply via email to