Hi, On Tue, May 11, 2010 at 11:10:04AM +0200, Troels Henriksen wrote: > The attached patch lets you bind keys to small lines of Javascript to > run. > > The intent is that the usual ~/.surf/script.js defines various methods, > which are then run by the bindings. This is much cleaner than having > script.js create its own event listeners for keybindings going outside > surf's own system.
This works brilliantly - thank you. If anyone was wondering how to add
keybindings to your config file, this is what I have in config.h for
hinting (that works):
{ 0, GDK_f, eval, { .v = (char *[]){
"hintMode()", NULL } } },
{ 0, GDK_F, eval, { .v = (char *[]){
"hintMode(true)", NULL } } },
{ 0, GDK_Escape, eval, { .v = (char *[]){
"removeHints()", NULL } } },
... and just comment out the line document.addEventListener all the way
down to the end of the hinting script in script.js.
S
--
Sean Whitton / <[email protected]>
OpenPGP KeyID: 0x3B6D411B
http://seanwhitton.com/
signature.asc
Description: Digital signature
