Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: puppybyte! on February 28, 2022, 02:22:33 PM

Title: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on February 28, 2022, 02:22:33 PM
I am using TC13 with JWM windowmanager, works well except I am used to windows key rather than alt key to launch a program.  Normally in JWM in other distros Alt (A) key can be substituted for windows key by (4).  Modifying the line   <Key mask="A" key="t">exec:aterm</Key>,  to  <Key mask="4" key="t">exec:aterm</Key> and rebooting does not work.  Anyone know a solution for this?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: patrikg on February 28, 2022, 03:05:34 PM
Did you forget to add the edited file to the file "/opt/.filetool.lst" and also forget to execute the "filetool -bv" to make a backup, so tc can copy over your edited file into correct location when booting.
 
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on February 28, 2022, 10:11:47 PM
my .filetool.lst already includes home, and .jwmrc-keys is within the home folder, right?, anyway but to make sure I added home/tc/.jwmrc-keys to the .filetool.lst, also made sure to backup with your suggestion of "filetool -bv" and rebooted.  After reboot superkey still does not work, and opening up the .jwmrc-keys the line  <Key mask="4" key="t">exec:aterm</Key> is there.  Any other thoughts? I appreciate the input.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: curaga on March 01, 2022, 05:13:24 AM
It may be a different key under tinyX vs Xorg. Use tools like xev to see what it is.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 01, 2022, 11:57:36 AM
It may be a different key under tinyX vs Xorg. Use tools like xev to see what it is.

not installed in TC13, no applications that match xdev...
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 01, 2022, 12:55:41 PM
Hi puppybyte!
It's  xev , not xdev. You can find it in  Xorg-7.7-bin.tcz:
http://tinycorelinux.net/13.x/x86/tcz/Xorg-7.7-bin.tcz.list
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 01, 2022, 04:57:46 PM
thanks, after xev, I get a small white window with a box,  I enter window key (on left lower keyboard), I get lots of output.  Is this correct or do I move the mouse cursor into the box on the white window and press window key???
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 01, 2022, 05:28:51 PM
Hi puppybyte!
Try it like this to reduce the extra output:
Code: [Select]
xev -event keyboard
... do I move the mouse cursor into the box on the white window and press window key???
The white window only needs to have focus. The mouse cursor can be anywhere.
Press the Windows key and the information will be displayed.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 01, 2022, 08:13:44 PM
after I press L lower windowkey I get the following

Code: [Select]
tc@box:~$ xev -event keyboard
Outer window is 0xa00001, inner window is 0xa00002

KeymapNotify event, serial 17, synthetic NO, window 0x0,
    keys:  48  0   0   0   16  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 23, synthetic NO, window 0xa00001,
    root 0x3a, subw 0x0, time 123654, (607,312), root:(651,388),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyPress event, serial 25, synthetic NO, window 0xa00001,
    root 0x3a, subw 0x0, time 127965, (607,312), root:(651,388),
    state 0x0, keycode 133 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XmbLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

KeyRelease event, serial 25, synthetic NO, window 0xa00001,
    root 0x3a, subw 0x0, time 128085, (607,312), root:(651,388),
    state 0x0, keycode 133 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 1 bytes: (00) ""
    XFilterEvent returns: False

Is the keycode 133 information I need?, now how do I get the keyboard to work with windows key in JWM window manager?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 01, 2022, 08:42:50 PM
Hi puppybyte!
I'm not sure, but you may not have something set up correctly. This is what I get when I press/release the left and
then right Windows key:
Code: [Select]
KeyPress event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70866216, (474,812), root:(477,828),
    state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70866368, (474,812), root:(477,828),
    state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70870208, (474,812), root:(477,828),
    state 0x10, keycode 134 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70870320, (474,812), root:(477,828),
    state 0x50, keycode 134 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Please do not quote posts in their entirety every time you respond.
If you wish to respond to a particular part of a previous post, only quote that part.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 02, 2022, 08:06:36 AM
Hi puppybyte!
I'm not sure, but you may not have something set up correctly. This is what I get when I press/release the left and
then right Windows key:
Code: [Select]
KeyPress event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70866216, (474,812), root:(477,828),
    state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2c00001,
    root 0x9f, subw 0x0, time 70866368, (474,812), root:(477,828),
    state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Isn't the left super keycode the same 133?, on my dell inspiron 6000, there is no right window key.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 02, 2022, 10:01:23 AM
Hi puppybyte!
The results you quoted are both for the left Windows key. The first one is for when the key is pressed, and the
second one is for when the key is released. If you look again at reply #9, you will see 2 more results. Those are
for when the right Windows key (keycode 134) was pressed and then released.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 02, 2022, 10:48:52 AM
Hi puppybyte!
The results you quoted are both for the left Windows key. The first one is for when the key is pressed, and the
second one is for when the key is released. If you look again at reply #9, you will see 2 more results. Those are
for when the right Windows key (keycode 134) was pressed and then released.

Given the result of xev command, any chance I can modify windows key to replace Alt in JWM window manager
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 02, 2022, 11:06:51 AM
Hi puppybyte!
This is what your keyboard returned:
Code: [Select]
state 0x0, keycode 133 (keysym 0x0, NoSymbol), same_screen YES,
state 0x0, keycode 133 (keysym 0x0, NoSymbol), same_screen YES,
This is what my keyboard returned:
Code: [Select]
state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
state 0x50, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,

It looks like your key has no keysym assigned. Try this:
Code: [Select]
xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"Then run the  xev  command and see if the key says Super_L now.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 02, 2022, 01:05:04 PM
Hi puppybyte!
If this works for you and you want to make it permanent, this should work:
Code: [Select]
echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKeyPay close attention to the punctuation right after  Super_L.

Run a backup and reboot. Your key should still have the correct keysym.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 02, 2022, 05:24:59 PM
Hi puppybyte!
If this works for you and you want to make it permanent, this should work:
Code: [Select]
echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKeyPay close attention to the punctuation right after  Super_L.

Run a backup and reboot. Your key should still have the correct keysym.

thanks, I confirmed the key has the correct keysym now.  I tried
<Key mask="4" key="t">exec:aterm</Key>  and <Key mask="133" key="t">exec:aterm</Key> in the ~/.jwmrc-keys file  but still windowskey+t does not launch aterm.  I appreciate your careful reply.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 02, 2022, 11:10:29 PM
Hi puppybyte!
...  and <Key mask="133" key="t">exec:aterm</Key>  ...
That's not a valid value for mask:
Quote
Here mask specifies the modifier keys that must be held to enable this action and key specifies the key that is to be
pressed. keycode may be specified instead of key if the key code is known but the key is not (or there is no symbol for
the key code). action is the action performed when this combination is pressed. The mask section is optional. It can
contain any number of the following values:

    A - Alt (mod1)
    C - Control
    S - Shift
    1 - mod1
    2 - mod2
    3 - mod3
    4 - mod4
    5 - mod5
Found here:
https://joewing.net/projects/jwm/config-2.3.html#keys

If you want to verify which  mod  your  Super_L  is assigned to, just run:
Code: [Select]
xmodmap
Do you have a  /home/tc/.jwmrc  configuration file? Does it have an  Include  directive for  ./.jwmrc-keys  at the end?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 03, 2022, 10:49:53 AM
Hi puppybyte!

If you want to verify which  mod  your  Super_L  is assigned to, just run:
Code: [Select]
xmodmap
Do you have a  /home/tc/.jwmrc  configuration file? Does it have an  Include  directive for  ./.jwmrc-keys  at the end?

my xmodmap gives
Code: [Select]
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40)
mod2        Num_Lock (0x4d)
mod3     
mod4        Mode_switch (0x6c)
mod5   

I don't see any mention of windows key on mod4.

I do have .jwmrc file and it does include the directive for ./.jwmrc-keys.

thanks
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 03, 2022, 11:07:25 AM
Hi puppybyte!
Try this:
Code: [Select]
xmodmap -e add Mod4 = Super_L
xmodmap
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 03, 2022, 11:44:39 AM
Here Rich
Code: [Select]
tc@box:~$ xmodmap -e add Mod4 = Super_L
xmodmap:  commandline:1:  bad add modifier input line
xmodmap:  unable to open file 'Mod4' for reading
xmodmap:  unable to open file '=' for reading
xmodmap:  unable to open file 'Super_L' for reading
xmodmap:  4 errors encountered, aborting.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 03, 2022, 02:15:23 PM
Hi puppybyte!
I'm sorry, there should have been quotes in that command:
Code: [Select]
xmodmap -e "add Mod4 = Super_L"
xmodmap
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 03, 2022, 03:56:51 PM
Rich: thanks it did take the command.
Code: [Select]
tc@box:~$ xmodmap
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40)
mod2        Num_Lock (0x4d)
mod3     
mod4        Mode_switch (0x6c),  Super_L (0x85)
mod5     

after confirming the key works, I gave it the command echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKey
to autostart and now I can launch my applications using windowskey rather than alt!!

please mark it solved.  thanks again. ;D ;D
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 03, 2022, 04:34:21 PM
Hi puppybyte!
You are welcome. Marked as solved.

If you reboot, is the Mod4 setting remembered?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 03, 2022, 05:15:17 PM
As you suspected Mod4 setting is not retained. I have to type in  xmodmap -e "add Mod4 = Super_L"
again.  The same command is in the ~/.X.d/LeftWinKey.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 03, 2022, 05:23:55 PM
Hi puppybyte!
This should do it:
Code: [Select]
echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKey
Code: [Select]
echo 'xmodmap -e "add Mod4 = Super_L"' >> .X.d/LeftWinKeyReboot and see if it worked.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 03, 2022, 05:34:43 PM
RIch: works perfectly after a reboot.  thanks! :) :)

Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 03, 2022, 05:36:32 PM
Hi puppybyte!
You are welcome. Thank you for confirming it worked.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 07, 2022, 11:39:24 AM
I am using TC13 with JWM windowmanager, works well except I am used to windows key rather than alt key to launch a program.  Normally in JWM in other distros Alt (A) key can be substituted for windows key by (4).  Modifying the line   <Key mask="A" key="t">exec:aterm</Key>,  to  <Key mask="4" key="t">exec:aterm</Key> and rebooting does not work.  Anyone know a solution for this?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 07, 2022, 12:12:39 PM
Hi puppybyte!
I don't understand your last post. Are you saying it no longer works?
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: puppybyte! on March 07, 2022, 06:43:22 PM
Hi Rich:

sorry about that post, it works very well.  All solved.
Title: Re: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?
Post by: Rich on March 07, 2022, 07:53:58 PM
Hi puppybyte!
OK, no problem.