General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
alt + enter = open URL in new tab
Posted by: DannyD
Date: February 20, 2009 04:10PM

Greetings,

I wanted the browser to open a URL in a new tab whenever I insert it with ALT+ENTER into the location bar. (And whenever I just press just ENTER, I want the URL to be loaded into the current tab - or whatever is configured in "kmeleon.general.openurl"). This is what I am used to from FF and IE.

I first tried the following entry in "accel.cfg":
ALT VK_RETURN = ID_OPEN_LINK_IN_BACKGROUNDTAB
But that didn't work, for whatever reason. (If you know that reason, please tell me.)


My solution was to put the following entry into "accel.cfg":
ALT VK_RETURN = macros(alt_enter)
and create the following macro (copy and paste this into a blank file named "alt_enter.kmm" and put it into your macro directory):

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- alt_enter.kmm
#
# Dependencies        : alt_enter.kmm
# Resources           : -
# Preferences         : -
# Version             : 0.1  2/20/09   DannyD
# --------------------------------------------------------------------------------

alt_enter{
	opentab( $URLBAR );
}

$macroModules = $macroModules."alt_enter;";

Now, I'm sure that you K-Meleon pros all know a way to archieve just the same with one magical switch in the configuration - so hit me. smiling smiley

DannyD

Options: ReplyQuote
Re: alt + enter = open URL in new tab
Posted by: desga2
Date: February 20, 2009 05:55PM

Quote
DannyD
ALT VK_RETURN = ID_OPEN_LINK_IN_BACKGROUNDTAB
But that didn't work, for whatever reason. (If you know that reason, please tell me.)

This not work because this is for LINKS, not for address or URL bar.
Already exist an accelerator to do this: CTRL ALT N
Right click in Go button on toolbar and select "Open In New Page", but your solution isn't bad. smiling smiley

Existed accelerator call to "macros(Go_New)" default function defined in main.kmm file.

There are Preferences to setting this but not as you like; Preferences -> Browsing -> In Open select "Typed URLs" and mark option "In a new tab".

ALT VK_RETURN accelerator isn't used because this had some problems with Gecko defaults accelerator keys at least in before versions.

With this you don't need change accel.cfg file, all in one macro file is better because you can disable the macro from Preferences -> Macro Extension.

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- alt_enter.kmm -------------------------------------------------------
#
# Dependencies        : main.kmm
# Resources           : -  
# Preferences         : -
# Version             : 0.2  2/20/09   desga2
# --------------------------------------------------------------------------------

alt_enter{
	opentab( $URLBAR );
}
	
_alt_enter_SetAccels{
	setaccel("ALT VK_RETURN", "macros(alt_enter)");
	# You can use this instead to define a new macro function:
	#setaccel("ALT VK_RETURN", "macros(Go_New)");
}
	
$OnInit=$OnInit."_alt_enter_SetAccels;";
$macroModules=$macroModules."alt_enter;";

K-Meleon in Spanish



Edited 1 time(s). Last edit at 02/20/2009 05:56PM by desga2.

Options: ReplyQuote
Re: alt + enter = open URL in new tab
Posted by: DannyD
Date: February 21, 2009 07:01PM

:cool: I knew it.
I particularly like the use of Go_New().

Options: ReplyQuote


K-Meleon forum is powered by Phorum.