How to combine win key for key bindings (SOLVED)

Using applications, configuring, problems
Post Reply
Message
Author
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

How to combine win key for key bindings (SOLVED)

#1 Post by yosi666 »

Hi,
I want to modify my jwmrc-personal, specifically this key binding that shows the desktop when pressing the windows key:

Code: Select all

<Key keycode="115">showdesktop</Key>
I would like to show desktop (or any other action) combining the windows key with any other one. For example, show desktop pressing win+d (like in windows).
I have tried modifying the jwmrc myself but haven't find the solution yet.
Any suggestion?
Thanks
Last edited by yosi666 on Sun 16 Feb 2014, 06:00, edited 1 time in total.
User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

Perhaps this thread will point the way. Read the whole thing, if there's an answer there to your question, it's toward the end. :)
User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

Re: How to combine win key for key bindings

#3 Post by jtwdyp »

yosi666 wrote:Hi,
I want to modify my jwmrc-personal, specifically this key binding that shows the desktop when pressing the windows key:

Code: Select all

<Key keycode="115">showdesktop</Key>
Hmmmnn, I don't have that one in my /root/.jwm/jwmrc-personal file.
Neither in my Slacko 5.6 nor my Precise 5.7.1 {Frugal} Puppies.

I've never actually changed any of the 'keycode=' bindings, but I think that
one (assuming 115 is the key code for the windows key) might have interfered
with the way I use it as a modifier key. {see below}
I would like to show desktop (or any other action) combining the windows key with any other one. For example, show desktop pressing win+d (like in windows).
I have tried modifying the jwmrc myself but haven't find the solution yet.
Any suggestion?
Thanks
Well that's exactly what I do with the windows key. For this to work you
may need to delete any binding that refers ti the windows key by it's
keycode value from your:

/root/.jwm/jwmrc-personal

file. Put any action you want to trigger with a "win+{otherkey(s)}" binding
in a line something like this one that I use to open the window menu with "win+space":

Code: Select all

<Key mask="4" key="space">window</Key>
or even this one I open my email client with "shift+win+a":

Code: Select all

<Key mask="S4" key="a">exec:konsole --workdir ~/mail -e alpine</Key>
I've found that when it comes to "mask=" bindings I need to replicate them
in the appropriate section of both:
/root/.jwmrc
&
/etc/xdg/templates/_root_.jwmrc
as well...

Then after editing all three files, I save the session. And finally restart jwm...
[color=brown][size=67]
--
JtWdyP

[/size][/color]
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

#4 Post by yosi666 »

Thank you both for your answers!
I have tried installing xdotool and couldn't find the command to show the desktop and then use it with xbindkeys config tool

I also tried these lines in the three files that jtwdyp mentioned:

Code: Select all

<Key mask="115" key="d">showdesktop</Key>
<Key mask="4" key="d">showdesktop</Key>
But didn't work. :cry: . I think I am missing something basic. Maybe has anything to do that I am using a netbook?
Jasper

#5 Post by Jasper »

Hi,

Code: Select all

<Key mask="4" key="d">showdesktop</Key>
should work after "Restart jwm" or "Restart X" so long as Win+d is not already set as a desktop shortcut and jwm is the selected Window Manager.

'''''''''''
Personally, I prefer to use the Win key with ALL my desktop shortcuts rather than with any keycodes.

My regards

PS I like Alt+z (z for zap) - merely substitututing "z" for "F4" in jwm personal - because Alt+z is easier to reach than Alt+F4.
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

#6 Post by yosi666 »

Still can't make it work.
This is my jwmrc-personal keybindings section:

Code: Select all

<!-- Key bindings -->
<Key mask="4" key="d">showdesktop</Key>
<Key mask="CA" key="g">exec:geany</Key>
<Key mask="CA" key="t">exec:xterm</Key>
<Key mask="CA" key="m">exec:gnome-player</Key>
<Key mask="CA" key="x">exec:xfe</Key>
<Key mask="CA" key="r">exec:rox</Key>
<Key mask="CA" key="i">exec:chromium.sh</Key>
<Key mask="CA" key="f">exec:pfind</Key>
<Key mask="CA" key="o">exec:soffice</Key>
<Key mask="C" key="Escape">exec:restartwm</Key>
<Key key="F10">showdesktop</Key>
<Key key="Up">up</Key>
<Key key="Down">down</Key>
<Key key="Right">right</Key>
<Key key="Left">left</Key>
<Key key="h">left</Key>
<Key key="j">down</Key>
<Key key="k">up</Key>
<Key key="l">right</Key>
<Key key="Return">select</Key>
<Key key="Escape">escape</Key>	
<Key key="F12">root:3</Key>

<Key mask="A" key="Tab">next</Key>
<Key mask="A" key="F4">close</Key>
<Key mask="A" key="F10">maximize</Key>
<Key mask="A" key="F6">minimize</Key>
<Key mask="A" key="F7">desktop#</Key>
<Key mask="A" key="F1">root:3</Key>
<Key mask="A" key="F2">window</Key>

<Key keycode="160">exec:amixer sset Master toggle</Key>
<Key keycode="176">exec:amixer sset Master 1+,1+</Key>
<Key keycode="174">exec:amixer sset Master 1-,1-</Key>
<Key keycode="178">exec:defaultbrowser</Key>
<Key keycode="236">exec:defaultbrowser</Key>
<Key keycode="111">exec:screeny</Key>
And this is the section in both _root_.jwmrc and .jwmrc:

Code: Select all

<!-- Key bindings -->
<Key key="Up">up</Key>
<Key key="Down">down</Key>
<Key key="Right">right</Key>
<Key key="Left">left</Key>
<Key key="h">left</Key>
<Key key="j">down</Key>
<Key key="k">up</Key>
<Key key="l">right</Key>
<Key key="Return">select</Key>
<Key key="Escape">escape</Key>

<Key mask="4" key="d">showdesktop</Key>
<Key mask="A" key="Tab">next</Key>
<Key mask="A" key="F4">close</Key>
<Key mask="A" key="#desktop#">desktop#desktop#desktop#</Key>
<Key mask="A" key="F1">root:3</Key>
<Key mask="A" key="F2">window</Key>
Jasper

#7 Post by Jasper »

Hi,

In jwmrc-personal (and nowhere else) what happens if at the end of your first section of your screen shot you add a hash mark to comment out the first line shown below.
Then, add the second line, then Restart jwm, then test hide/show all windows using only F12?

Code: Select all

#<Key key="F12">root:3</Key>
<Key key="F12">showdesktop</Key>
If that works - can you find the Win key (obviously not "4" in your case) to use in combination Win+d?

My regards
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

#8 Post by yosi666 »

Hi again, Jasper.
I already have it assigned to my F10 key and it works fine (you can see it in my personal file). Could that be the problem?

How do I find my windows key? with xev I get the 115 keycode
User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#9 Post by jtwdyp »

yosi666 wrote:Hi again, Jasper.
I already have it assigned to my F10 key and it works fine (you can see it in my personal file). Could that be the problem?
If you mean because you have another key assigned to the same function?
Don't think so. On my Puppies I have both;

<Key mask="AC" key="space">window</Key>
and:
<Key mask="4" key="space">window</Key>

Both work.

I looked at your bindings. You say the:
<Key key="F10">showdesktop</Key>
works... In which case I would have expected:
<Key mask="4" key="d">showdesktop</Key>
to work.... Out of curiosity, have you tried it using mask values that are known to work on your machine? Perhaps:

<Key mask="CA" key="d">showdesktop</Key>

And/or have you tried the mod4 mask with another binding? Perhaps even my:

<Key mask="4" key="space">window</Key>

binding? Otherwise, Jasper is likely right when he suggests that "4" isn't the right mask for your netbook's win key... :(
How do I find my windows key? with xev I get the 115 keycode
Don't know... I found that "4" for mod4 worked for me on my gateway laptop, and 2 different HP desktops by trial & error... I remember having looked {unsuccessfully} for a tool to find that out.

I can't remember where I read the help text that explained what mod{num} keys were supported, But it seemed like a very limited selection. :cry:

If you find a way to test for that, please include it in this thread...
[color=brown][size=67]
--
JtWdyP

[/size][/color]
npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#10 Post by npierce »

What version of JWM do you have?

Code: Select all

jwm -v
There a couple of possible solutions, depending upon which version you have.

1.
Mask names "1" through "5" are used for JWM version svn-474 and newer. JWM version svn-470 and older used "H" (Hyper), "M" (Meta), and "P" (Super). So if you have an old Puppy with an old JWM, you may need to use "P".

2.
For newer JWM, the actual keys assigned to the names "1" through "5" may vary depending upon the keyboard and the keymap used. To see the current assignments for your keymap, use the xmodmap -pm command, which should show you something similar to this:

Code: Select all

# xmodmap -pm
xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x6d)
mod1        Alt_L (0x40),  Alt_L (0x7d),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x5d),  ISO_Level3_Shift (0x7c)
This shows that the "Super_L" (a.k.a. left Windows) key is mod4 (which JWM calls "4"), which is what it is commonly assigned to, but yours may be assigned differently, or may be missing.

For more detail see: http://www.murga-linux.com/puppy/viewto ... 052#673052
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

#11 Post by yosi666 »

Sorry, for my late response, I have been out for a while.
I have seen that my windows key is assigned to mod4 so key mask=4 was right. Other key masks work fine. Well, I guess I will only have it with my F10 key...
npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#12 Post by npierce »

Code: Select all

I have seen that my windows key is assigned to mod4 so key mask=4 was right.
Good. So Super_L is mod4.

So, since it isn't working for you, your keymap probably doesn't map keycode 115 to Super_L. Some keymaps (including the Spanish keymap) don't assign any symbol to keycode 115. You can customize your keymap by doing the following:

Add the following line to the end of your /root/.Xmodmap file. If the file does not already exist, create it:

Code: Select all

keycode 115 = Super_L
Then tell X to read that file by entering this command in a terminal window:

Code: Select all

xmodmap /root/.Xmodmap
yosi666
Posts: 111
Joined: Tue 13 May 2008, 14:41

#13 Post by yosi666 »

Great!!!! Now it works.
Thank you very much
npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#14 Post by npierce »

You are very welcome.
User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#15 Post by ASRI éducation »

I just read the previous messages.
With the proposed solutions, I've added many useful shortcuts.

A big thank you to the contributors!

Note: I use a modified version of Precise Puppy 5.7.1 (ASRI Edu 310).

Regards
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]
Post Reply