MozillaZine

keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Mattsson.Jonas
 
Posts: 2
Joined: March 3rd, 2006, 5:49 am

Post Posted March 3rd, 2006, 5:55 am

Hi!
Is it possible (if yes, how?) to use mouse buttons as shortcuts?
i would like to go "Back" by pressing CTRL+"left mouse button" and forward on CTRL+"right mouse button"
(i've got CTRL on my thumb-button so this would give more power to the mouse)

Thx!
/Jonas

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted March 4th, 2006, 3:56 am

Mattsson.Jonas wrote:Is it possible (if yes, how?) to use mouse buttons as shortcuts?
No.

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted March 4th, 2006, 6:31 am

Mattsson.Jonas wrote:this would give more power to the mouse

If you want more power for the mouse, why not try a mouse gestures extension like Mouse Gestures or All-in-one Gestures instead? They're about the keyconfig equivalent for the mouse.

Mattsson.Jonas
 
Posts: 2
Joined: March 3rd, 2006, 5:49 am

Post Posted March 6th, 2006, 12:18 am

thats a good idea! but not what i wanted. i don't want to move my mouse around i want to be able to click some combinations to let some of the most common actions happen.
thx anyway! i might go with that solution if i cant find any other!

alta88
 
Posts: 1020
Joined: January 28th, 2006, 3:08 pm

Post Posted March 16th, 2006, 9:28 am

hi dorando, need a bit more help with the arrow keys to do find, per a page back or so..

arrow keys work fine, but i also need to use them when invoking the findbar dialog by button or /, eg if the input field is not blank, then arrow key does find next exactly like F3.

i looked at the code in toolkit.jar and added a second if statement like so:

if(findService.searchString.length > 0)
stonie_findSelection(0);

but that didn't do it. i'm on thin ice trying to read code anyway.. any ideas?

Mickey73

User avatar
 
Posts: 26
Joined: March 4th, 2006, 12:16 pm
Location: Toronto

Post Posted March 18th, 2006, 12:31 pm

Hi guys,
This is the first time I try using KeyConfig, and I'd like to add 2 thing to have shortcuts, can you please help?
I have 2 bookmarklets, Increment & Decrement, to navigate through images. How can I have "Ctrl+Up Arrow" doing Increment, & "Ctrl+Down Arrow" doing Decrement?
Thank you.

old zeniko
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted March 18th, 2006, 12:48 pm

Assign keywords to your bookmarklets and use then the following code (replace KEYWORD with the assigned keywords):
Code: Select all
content.location = getShortcutOrURI("KEYWORD", {});

Mickey73

User avatar
 
Posts: 26
Joined: March 4th, 2006, 12:16 pm
Location: Toronto

Post Posted March 18th, 2006, 1:30 pm

At the risk of sounding very ignorant, what do you mean by "keyword" and how do you do that? Please forgive me. :-(

Mickey73

User avatar
 
Posts: 26
Joined: March 4th, 2006, 12:16 pm
Location: Toronto

Post Posted March 18th, 2006, 1:37 pm

Spoke too soon. I right clicked on the bookmarklet, and there it was, staring me in the eye, Keyword....... ;-)
Sorry, I've been using FireFox for only a couple of weeks, and so far I've learned a million things.
Anyways, thank you very much, it worked. People around here are amazing.

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted March 19th, 2006, 5:14 am

alta88 wrote:hi dorando, need a bit more help with the arrow keys to do find, per a page back or so..

arrow keys work fine, but i also need to use them when invoking the findbar dialog by button or /, eg if the input field is not blank, then arrow key does find next exactly like F3.

i looked at the code in toolkit.jar and added a second if statement like so:

if(findService.searchString.length > 0)
stonie_findSelection(0);

but that didn't do it. i'm on thin ice trying to read code anyway.. any ideas?
The problem is that the findbar textbox receives the focus and those handle these keys themselves. To handle these it would be necessary to capture the event before it reaches the textbox (while some <a href="http://xulplanet.com/references/elemref/ref_key.html#attr_phase">sources</a> suggests that it is possible change the event phase of a <key> I wasn't able to get it working) so you could build a custom extension (starting with a <a href="http://dev.dorando.at/mozilla/blank.xpi">blank</a> one) and use some code similar to this (insert it in overlays/browser.xul between the <script></script>):
Code: Select all
document.getElementById("find-field").
addEventListener("keypress",function(event){

 switch(event.keyCode) {
  case event.DOM_VK_LEFT:
   if(event.target.selectionStart == 0)
    findPrevious();
   break;
  case event.DOM_VK_RIGHT:
   if(event.target.selectionEnd == event.target.textLength)
    findNext();
   break;
 }

},false);

oab2
 
Posts: 3
Joined: March 24th, 2006, 12:59 pm

Post Posted March 24th, 2006, 1:04 pm

Is there a way to make FF use ctrl+enter instead of alt+enter for opening new tabs? I am used to using Mozilla and that is how it works. Also ctrl makes more sense to me as it is already conected to tabs, example: ctrl+click opens link in new tab and ctrl+enter in Googlebar opens search in a new tab.

All I want is to do is make alt+enter open stuff with .com extension and make ctrl+enter open new tab.

thanks,
oab2

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted March 25th, 2006, 2:23 am

Build a custom extension (starting with a <a href="http://dev.dorando.at/mozilla/blank.xpi">blank</a> one) and use the following code (insert it in overlays/browser.xul between the <script></script>):
Code: Select all
eval("BrowserLoadURL ="+BrowserLoadURL.toString().replace(
/altKey/g,
'ctrlKey'
));

eval("canonizeUrl ="+canonizeUrl.toString().replace(
/ctrlKey/g,
'altKey'
));

oab2
 
Posts: 3
Joined: March 24th, 2006, 12:59 pm

Post Posted March 25th, 2006, 9:42 am

dorando wrote:Build a custom extension (starting with a <a href="http://dev.dorando.at/mozilla/blank.xpi">blank</a> one) and use the following code (insert it in overlays/browser.xul between the <script></script>):
Code: Select all
eval("BrowserLoadURL ="+BrowserLoadURL.toString().replace(
/altKey/g,
'ctrlKey'
));

eval("canonizeUrl ="+canonizeUrl.toString().replace(
/ctrlKey/g,
'altKey'
));


Thanks for the response. That sorta works. However when i control enter it does not open a new tap but loads in current tap. alt enter does add .com however. ctrl click doesn't work though. So maybe i need to learn to use alt. Why did they do this with FF?

dorando
 
Posts: 1203
Joined: January 9th, 2004, 9:57 am

Post Posted March 27th, 2006, 3:01 am

It works for me, maybe you've an extension installed which doesn't like this code (try to disable other extensions)?

alta88
 
Posts: 1020
Joined: January 28th, 2006, 3:08 pm

Post Posted March 27th, 2006, 9:45 am

dorando wrote:The problem is that the findbar textbox receives the focus and those handle these keys themselves. To handle these it would be necessary to capture the event before it reaches the textbox (while some <a href="http://xulplanet.com/references/elemref/ref_key.html#attr_phase">sources</a> suggests that it is possible change the event phase of a <key> I wasn't able to get it working) so you could build a custom extension (starting with a <a href="http://dev.dorando.at/mozilla/blank.xpi">blank</a> one) and use some code similar to this (insert it in overlays/browser.xul between the <script></script>):
Code: Select all
document.getElementById("find-field").
addEventListener("keypress",function(event){

 switch(event.keyCode) {
  case event.DOM_VK_LEFT:
   if(event.target.selectionStart == 0)
    findPrevious();
   break;
  case event.DOM_VK_RIGHT:
   if(event.target.selectionEnd == event.target.textLength)
    findNext();
   break;
 }

},false);


i had been pondering whether to figure out how to make this extension, and if that were even the better long term method to solve this, given i probably have loads of tiny tweaks and it would take 2 files per, pretty manual as opposed to automated work (and greasemonkey couldn't help), new Fx coming, etc.

well, with zeniko's userChrome.js extension, i just popped this code into a file and it worked as expected.

thanks to you both!

(although it would be nice to have keyconfig take over events before anything else gets them..)

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest