General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: December 26, 2020 03:48PM

How to Disable "DEL"-Key for "Go Back a Page"?

When editing on a forum page I often accidentally touch the (very sensitive) keypad (bringing the cursor outside the edit window) - and if then the DELETE-Key (backspace, not forward delete) is pressed (while wanting to delete some misspelled letters) that page goes back to the last page (before opening the edit window) - and then going forward again all the written text is lost ...

How to disable the DELETE/backspace-Key (not the forward-delete) having the function of "going back one page"?

Next problem - same category:

How to type ~ with German Keyboard Layout with BootCamp on Mac?

I have here a MacBook with Windows. Usually I use both (alternating) Swiss German (CHD) (for à/é/è/ç/ë/À/É/È) and German (DEU) (for ß, as this is missing in CHD Layout). When writing in discussions in Wikipedia the signature is done with ~~~~ ... Now there is following problem: with CHD the ~ (as a separate letter) is written with the key just left of backspace (in CHD ^). This key is a dead key in CHD; it is meant to write over some special letters. So if you press it once nothing happens yet; if you press some special letters (ã/õ/ñ) the ~ is put on top of them. If you press it twice, two of them are written. With German Keyboard Layout (DEU) the ~ is on the key just below just left of the return key in the upper row (of the two middle rows) - and it is not a dead key; pressing it once immediately writes the ~ sign as a separate letter.

But so far this should not be a problem - but it is, as with BootCamp on a Mac with Windows you don't have the normal alt-group key; instead you have to press ctrl-alt instead (both at the left hand). Also so far this should not be a problem - but there still is one ...

Now with CHD-Keyboard typing ~ is not the problem; but typing it with DEU-Keyboard: if you press ctrl-alt-+ (the key that should type the ~) nothing is written, but the screen zoom is increased in size.

Btw: this problem does not exist with other browsers (SRWare Iron or else)

Next Problem:

How to temporarily turn off mouseclick while editing in any kind of editable field (as here in the forum etc.)? The keypad only has one clickable key (no right click key - this is meant to be done with pressing control-click on the mac - or can also be done with two-finger-click). So when disabling touch-click mousing aroung gets uncomfortable. So is there a way to disable touch-click on the touchpad in connection with entering characters into an editable field?



Edited 4 time(s). Last edit at 01/22/2021 09:15AM by Voltaire.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: JohnHell
Date: December 26, 2020 05:10PM

Quote
Voltaire
How to Disable "DEL"-Key for "Go Back a Page"?

It is a default key combo set in default accel.cfg (K-meleon root > browser > defaults > settings > accel.cfg).

I'm not sure now if setting it in the profile accel.cfg to nothing would override it.

I think you should edit the accel.cfg in the profile too as it is copied there on profile creation.

Quote
Voltaire
Now with CHD-Keyboard typing ~ is not the problem; but typing it with DEU-Keyboard: if you press ctrl-alt-+ (the key that should type the ~) nothing is written, but the screen zoom is increased in size.

The same as above, but this is set on zoom.kmm default macro. You can just comment out with a # (hash) before the setaccel to ctrl alt vk_plus.

I know they are different keyboards layouts (mine spanish) but I thought CTRL ALT 4 (and later space, as with stand-alone tilde) would give the same results on most layouts. This wouldn't need the above edit.

Quote
Voltaire
So is there a way to disable touch-click on the touchpad in connection with entering characters into an editable field?

No clue.



Edited 2 time(s). Last edit at 12/26/2020 05:12PM by JohnHell.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: December 26, 2020 05:51PM

Sounds familiar...
Do a forum search for "Backspace", there should be some hits, a few years old.

In THIS forum here, after accidentally flipping back in tab history, it helps to set the browser Offlineby menu, then flip forward again - now the written text should appear again. Now set it ONline again.
This trick helps in some forums/websites (phorum/bbcode?), sadly not in all (IPS/msfn?)

But in general, when typing longer texts, it's always safer to do that in an external editor, like N++.... :cool:

Keyboard shortcuts / Accels can be a bit buggy, sometimes only changes in the default file work, although usually accels.cfg in profile should have priority. Perhaps was fixed in newer versions, no idea.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 18, 2021 12:31PM

OK, first try with some modifications in the accel.cfg (ALT-... changed to CTRL-...)

But some problems remain: I now have a customized keyboard layout on which the en-dash (–) is set to ALT-GR-"-" (ALT-GR-minus; corresponds to CTRL-ALT-minus – what is needed on a MacBook with Bootcamp); with the result that no en-dash is written, but the zoom decreased ...

How and where to get rid of that zoom keys? I don't need zooming on a keyboard shortcut.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: February 18, 2021 01:53PM

Zoom shortcuts are created in /macros/zoom.kmm

You can edit the OnInit Line, near bottom.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 19, 2021 09:09AM

I tried with a # in front of the four "setaccel("CTRL ALT VK_ ..." lines (they seem to be the same as the four "setaccel("ALT VK_ ..." lines just above) ... and this is working ... smiling smiley



Edited 1 time(s). Last edit at 02/19/2021 09:10AM by Voltaire.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: February 19, 2021 09:29AM

Quote
Voltaire
I tried with a # in front of the four "setaccel("CTRL ALT VK_ ..." lines (they seem to be the same as the four "setaccel("ALT VK_ ..." lines just above) ... and this is working ... smiling smiley

Ah right, you only wanna get rid of 1 key smiling smiley
The native ALT accels are all for zooming only images.
The native CTRL accels are all for Full Page zoom.



Edited 1 time(s). Last edit at 02/19/2021 09:39AM by siria.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 19, 2021 02:57PM

... oops – I did not pay enough attention ... OK, the upper four are for zoom images, the lower four for zoom page ... grinning smiley ... Btw: one # only is necessary; in front of the _Zoom_SetAccels{ ... line (this disables the whole block).

But as said: a) I do not care about zooming by keyboard, and b) I need the CTRL-ALT combination free for "AltGr" as the latter is not available on a Macintosh keyboard (press CTRL-ALT instead); and I have en-dash (–) on "AltGr-minus" and em-dash (—) on "Shift-AltGr-minus" (AltGr = CTRL-ALT). On a PC Keyboard (with AltG key) disabling zoom by keyboard is not necessary.

You mean I could also have set a # only in front of $OnInit, and then these keys would be defined but this definition not activated?

Btw.: what is the difference between VK_PLUS and VK_ADD, and what is the difference between VK_MINUS and VK_SUBTRACT? "alphanumeric keyboard" vs. "numeric keypad"?



Edited 2 time(s). Last edit at 02/19/2021 09:32PM by Voltaire.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: JohnHell
Date: February 20, 2021 04:21PM

More or less accurate (looks like now some have the prefix OEM)
https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes



Edited 1 time(s). Last edit at 02/20/2021 04:24PM by JohnHell.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 21, 2021 11:42PM

Thanks for the list ... I just wondered where the VK_PLUS and VK_MINUS are on the list ... smiling smiley

But I miss quite a bunch of some other special characters in the list – like equal, paragraph, degree, ampersand, percent etc. ... I assume these could be other VK_OEM_ keys.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: JohnHell
Date: February 22, 2021 02:12AM

I just pointed to a source of this info, if you search around, probably (I don't know) you'll find more pages explaining them.

The minus and plus are with the OEM text.

Any developer will tell better the differences. I'm not. Search out there winking smiley Usually the both at the bottom are for the numeric keypad. I guess, I'm not sure. For what I vaguely remember.


VK_OEM_PLUS
0xBB

For any country/region, the '+' key
VK_OEM_MINUS
0xBD

For any country/region, the '-' key


VK_SUBTRACT
0x6D

Subtract key


VK_ADD
0x6B

Add key

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: February 22, 2021 05:28AM

> You mean I could also have set a # only in front of $OnInit, and then these keys would be defined but this definition not activated?

Well, almost: it means then only the macro function "_Zoom_SetAccels" would be defined, but not executed automatically at start of new sessions. Only if later called manually, by a menu or otherwise, it would then fire and define the setaccel commands.

Actually I had meant to only remove this first half, not disable the whole line, since additionally it creates the menu:
$OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";

> Btw.: what is the difference between VK_PLUS and VK_ADD, and what is the difference between VK_MINUS and VK_SUBTRACT? "alphanumeric keyboard" vs. "numeric keypad"?

Those giant old desktop keyboards had a separate numeric keypad at the right side, a calculator like bunch of number buttons. Am no expert either, but guess that's meant. This "number block" function still exists on laptops, after activating the "Numlock" key. Lock closely at the key for U I O, I K L etc, they should contain tiny numbers.

> But I miss quite a bunch of some other special characters in the list – like equal, paragraph, degree, ampersand, percent etc. ... I assume these could be other VK_OEM_ keys.

Perhaps those don't need any "VK" prefix, like normal letters A B C?
setaccel("CTRL ALT K","macros(xy)");
setaccel("CTRL ALT =","macros(xy)");

https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
Cool!



Edited 1 time(s). Last edit at 02/22/2021 05:36AM by siria.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 24, 2021 02:19PM

Quote
siria
> You mean I could also have set a # only in front of $OnInit, and then these keys would be defined but this definition not activated?

Well, almost: it means then only the macro function "_Zoom_SetAccels" would be defined, but not executed automatically at start of new sessions. Only if later called manually, by a menu or otherwise, it would then fire and define the setaccel commands.

Actually I had meant to only remove this first half, not disable the whole line, since additionally it creates the menu:
$OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";

OK, now I see what you mean ... grinning smiley

Btw: so far I set the # in front of the "_Zoom_SetAccels{"-line to not define the whole group so that it wont't bother me ... smiling smiley

But now I wonder that in the $OnInit-line the _Zoom_BuildButtonMenu is not mentioned ...

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: JohnHell
Date: February 24, 2021 03:07PM

Quote
Voltaire
OK, now I see what you mean ... grinning smiley

Btw: so far I set the # in front of the "_Zoom_SetAccels{"-line to not define the whole group so that it wont't bother me ... smiling smiley

But now I wonder that in the $OnInit-line the _Zoom_BuildButtonMenu is not mentioned ...

If you just set a hash symbol in front of that line you are creating a bug on macro language parsing on that file as you are leaving an unclosed curly bracket at the end.

This is wrong:

#_Zoom_SetAccels{
setaccel("CTRL VK_MULTIPLY","macros(Zoom_Reset)");
setaccel("ALT VK_PLUS","macros(Zoom_Images_In)");
setaccel("ALT VK_ADD","macros(Zoom_Images_In)");
setaccel("ALT VK_MINUS","macros(Zoom_Images_Out)");
setaccel("ALT VK_SUBTRACT","macros(Zoom_Images_Out)");
setaccel("CTRL ALT VK_PLUS","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_ADD","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_MINUS","macros(Zoom_Page_Out)");
setaccel("CTRL ALT VK_SUBTRACT","macros(Zoom_Page_Out)");
}
$OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";

This would be the correct way:

#_Zoom_SetAccels{
#setaccel("CTRL VK_MULTIPLY","macros(Zoom_Reset)");
#setaccel("ALT VK_PLUS","macros(Zoom_Images_In)");
#setaccel("ALT VK_ADD","macros(Zoom_Images_In)");
#setaccel("ALT VK_MINUS","macros(Zoom_Images_Out)");
#setaccel("ALT VK_SUBTRACT","macros(Zoom_Images_Out)");
#setaccel("CTRL ALT VK_PLUS","macros(Zoom_Page_In)");
#setaccel("CTRL ALT VK_ADD","macros(Zoom_Page_In)");
#setaccel("CTRL ALT VK_MINUS","macros(Zoom_Page_Out)");
#setaccel("CTRL ALT VK_SUBTRACT","macros(Zoom_Page_Out)");
#}
$OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";


But these are the less interfering way with the macro file:

a) remove the menu creation and acceleration initialization

_Zoom_SetAccels{
setaccel("CTRL VK_MULTIPLY","macros(Zoom_Reset)");
setaccel("ALT VK_PLUS","macros(Zoom_Images_In)");
setaccel("ALT VK_ADD","macros(Zoom_Images_In)");
setaccel("ALT VK_MINUS","macros(Zoom_Images_Out)");
setaccel("ALT VK_SUBTRACT","macros(Zoom_Images_Out)");
setaccel("CTRL ALT VK_PLUS","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_ADD","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_MINUS","macros(Zoom_Page_Out)");
setaccel("CTRL ALT VK_SUBTRACT","macros(Zoom_Page_Out)");
}
# $OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";

b) just removing the setaccel macro module from the browser initialization

_Zoom_SetAccels{
setaccel("CTRL VK_MULTIPLY","macros(Zoom_Reset)");
setaccel("ALT VK_PLUS","macros(Zoom_Images_In)");
setaccel("ALT VK_ADD","macros(Zoom_Images_In)");
setaccel("ALT VK_MINUS","macros(Zoom_Images_Out)");
setaccel("ALT VK_SUBTRACT","macros(Zoom_Images_Out)");
setaccel("CTRL ALT VK_PLUS","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_ADD","macros(Zoom_Page_In)");
setaccel("CTRL ALT VK_MINUS","macros(Zoom_Page_Out)");
setaccel("CTRL ALT VK_SUBTRACT","macros(Zoom_Page_Out)");
}
$OnInit=$OnInit."_Zoom_BuildMenu;";



Edited 1 time(s). Last edit at 02/24/2021 03:09PM by JohnHell.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: February 24, 2021 03:44PM

Quote
Voltaire
Btw: so far I set the # in front of the "_Zoom_SetAccels{"-line to not define the whole group so that it wont't bother me ...

Yeah, as JohnHell explained already, a very bad and buggy idea:

#-signs disable only the current 1 line, not the following. Those remain active, and if not inside a macro, they may even run automatically before $OnInit. Depending on what they do, that can cause scary effects... (but no worry, only temporary. After fixing macro, all will be fine again after next restart)
Likewise, the still active closing } at the end, although there is no opening { before it anymore, will cause yet more bugs.

Quote
Voltaire
But now I wonder that in the $OnInit-line the _Zoom_BuildButtonMenu is not mentioned ...

This one is called by the BuildMenu macro, somewhere in its middle :cool:



Edited 1 time(s). Last edit at 02/24/2021 03:47PM by siria.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: Voltaire
Date: February 26, 2021 09:54AM

As said no error or flaw in any way so far ... but now I set it on the real hard way ... grinning smiley

# _Zoom_SetAccels{
#setaccel("CTRL VK_MULTIPLY","macros(Zoom_Reset)");
#setaccel("ALT VK_PLUS","macros(Zoom_Images_In)");
#setaccel("ALT VK_ADD","macros(Zoom_Images_In)");
#setaccel("ALT VK_MINUS","macros(Zoom_Images_Out)");
#setaccel("ALT VK_SUBTRACT","macros(Zoom_Images_Out)");
#setaccel("CTRL ALT VK_PLUS","macros(Zoom_Page_In)");
#setaccel("CTRL ALT VK_ADD","macros(Zoom_Page_In)");
#setaccel("CTRL ALT VK_MINUS","macros(Zoom_Page_Out)");
#setaccel("CTRL ALT VK_SUBTRACT","macros(Zoom_Page_Out)");
#}
#$OnInit=$OnInit."_Zoom_SetAccels;_Zoom_BuildMenu;";
$OnInit=$OnInit."_Zoom_BuildMenu;";

... so the _Zoom_BuildButtonMenu is not called directly (with OnInit), but (inside the _Zoom_BuildMenu) given to the kToolbars?

Btw: zoom buttons are welcome – but I not only don't need zoom on the keyboard — these keys are interfering with my keyboard layout.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: siria
Date: February 27, 2021 06:16AM

Quote
Voltaire
Btw: zoom buttons are welcome – but I not only don't need zoom on the keyboard — these keys are interfering with my keyboard layout.

Yeah you made that clear a few times, no prob smiling smiley
Further above you wrote you first had disabled only the 4 keys which where interfering, that was perfectly fine.
Of course it's also perfectly fine if you now prefer the complete accel macro removed, for all ALT+CTRL accels.
Actually your last two lines are what I had first suggested above, to just edit the $OnInit line. Changing just this line would usually be enough for that purpose. But no harm either to additionally remove the whole accel macro too.

Quote

... so the _Zoom_BuildButtonMenu is not called directly (with OnInit), but (inside the _Zoom_BuildMenu) given to the kToolbars?

No mystery:
_Zoom_BuildMenu{
(....)
setmenu(__Zoom_Out,macro,"&Reset Zoom",Zoom_Reset);
$kToolbars?&_Zoom_BuildButtonMenu:0;
# context menus
setmenu(ImageView,macro,"Zoom I&n",Zoom_Image_In);
setmenu(ImageView,macro,"Zoom Ou&t",Zoom_Image_Out);
}

Just riddling what you may mean with "given to the kToolbars",... suspect a misunderstanding...
If you want to go deeper, $kToolbars is merely a true/false variable. It's created in main.kmm, after reading this user pref (at startup):

$kToolbars=getpref(BOOL,"kmeleon.plugins.toolbars.load");

So, in the zoom macro, this line:
$kToolbars?&_Zoom_BuildButtonMenu:0;
just means:
is pref "kmeleon.plugins.toolbars.load" true? If yes, add the zoom buttons now, otherwise do nothing (zero actions)

Exactly the same effect, just easier to read for non-experts:
if (getpref(BOOL,"kmeleon.plugins.toolbars.load") == true) &_Zoom_BuildButtonMenu;



Edited 1 time(s). Last edit at 02/27/2021 06:57AM by siria.

Options: ReplyQuote
Re: How to alter keyboard shortcuts / key commands?
Posted by: anonymous
Date: February 27, 2021 08:16AM

@Voltaire
Custom shortcuts can disable/enable the keypad. A custom "Scancode Map" entry in Windows Vista registry can replace any key to emulate a PC keyboard.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.