Discussion:
Two questions please
(too old to reply)
root
2023-06-03 16:53:32 UTC
Permalink
My first question has to do with Fluxbox window manager: is there a way
or setting that I can force Fluxbox to keep the mouse attached to a given
window until I click on a new window? I'm pretty sure this relates to
"mouse focus" but I have been unable to any setting that does what I
want. For example, I may click on an Xterm and start reading a pdf
file in the xterm. As I am scrolling through the document with the mouse
wheel, the mouse pointer drifts around the screen because I'm not
paying attention to it while I read. If the mouse pointer drifts out
of bounds of the pdf display, I am suddenly tossed into some other
window. Can I attach the mouse to the original Xterm/PDF display?

Secondly, over the years I have wanted to either defeat CapsLock
or change it to Control when running under X. None of the remedies
that have been suggested to me have proved to be permanent. They
work for a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?

Thanks.
Lew Pitcher
2023-06-03 17:21:00 UTC
Permalink
Post by root
My first question has to do with Fluxbox window manager: is there a way
or setting that I can force Fluxbox to keep the mouse attached to a given
window until I click on a new window? I'm pretty sure this relates to
"mouse focus" but I have been unable to any setting that does what I
want. For example, I may click on an Xterm and start reading a pdf
file in the xterm. As I am scrolling through the document with the mouse
wheel, the mouse pointer drifts around the screen because I'm not
paying attention to it while I read. If the mouse pointer drifts out
of bounds of the pdf display, I am suddenly tossed into some other
window. Can I attach the mouse to the original Xterm/PDF display?
Yes, you can. You are correct that this behaviour relates to "mouse
focus" If you read fluxbox(1) ("man 1 fluxbox"), and look for the
section labeled "FOCUS MODEL", you will find a description of the
various mouse focus models available under fluxbox. To summarize,
you probably have "Mouse Focus" model enabled, as this causes the
the window manager to give focus to whichever window the mouse is
currently in. You likely want the other model: "Click to Focus",
which gives focus to whichever window you have "clicked" the mouse
in.

There are other, auxiliary, focus model settings that govern behavior
of tab focus, and new window focus.
Post by root
Secondly, over the years I have wanted to either defeat CapsLock
or change it to Control when running under X. None of the remedies
that have been suggested to me have proved to be permanent. They
work for a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?
Yes, with caveats.

Likely the suggestions you have seen depend on executing the xmodmap(1)
command with various arguments and inputs. For the mapping that you
inquire about, this is the utility to use. (There are other keyboard
mapping functions available in fluxbox, but these mostly provide
command shortcuts, and not keyboard key mapping. If this is what you
are looking for, read the fluxbox-keys(5) man page.)

If you place your xmodmap(1) key mappings in your $HOME/.Xmodmap file,
then you should get your proper key mappings when
a) you select fluxbox from the GDM/KDM/SSDM/XDM login screen, and
b) you startfluxbox(1) from the commandline

HTH
--
Lew Pitcher
"In Skills We Trust"
root
2023-06-03 22:26:49 UTC
Permalink
Post by Lew Pitcher
Yes, you can. You are correct that this behaviour relates to "mouse
focus" If you read fluxbox(1) ("man 1 fluxbox"), and look for the
section labeled "FOCUS MODEL", you will find a description of the
various mouse focus models available under fluxbox. To summarize,
you probably have "Mouse Focus" model enabled, as this causes the
the window manager to give focus to whichever window the mouse is
currently in. You likely want the other model: "Click to Focus",
which gives focus to whichever window you have "clicked" the mouse
in.
The options I have set are:
init:session.screen0.window.focus.alpha: 255
init:session.screen0.window.unfocus.alpha: 255
init:session.screen0.focusNewWindows: true
init:session.screen0.noFocusWhileTypingDelay: 0
init:session.screen0.focusSameHead: false
init:session.screen0.focusModel: ClickFocus
init:session.screen0.tabFocusModel: ClickToTabFocus
init.0:session.screen0.window.focus.alpha: 255
init.0:session.screen0.window.unfocus.alpha: 255
init.0:session.screen0.focusNewWindows: true
init.0:session.screen0.noFocusWhileTypingDelay: 0
init.0:session.screen0.focusSameHead: false
init.0:session.screen0.focusModel: ClickFocus
init.0:session.screen0.tabFocusModel: ClickToTabFocus
keys:OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
keys:OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}
keys:OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab}

It seems to me that ClickFocus is set. When I started using Fluxbox
I thought there was a clickable menu I could bring up to change
the configuration on the fly, but now I can't seem to get such a menu.
I middle click on the toolbar but only a few things come up.
Post by Lew Pitcher
There are other, auxiliary, focus model settings that govern behavior
of tab focus, and new window focus.
Post by root
Secondly, over the years I have wanted to either defeat CapsLock
or change it to Control when running under X. None of the remedies
that have been suggested to me have proved to be permanent. They
work for a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?
Yes, with caveats.
Likely the suggestions you have seen depend on executing the xmodmap(1)
command with various arguments and inputs. For the mapping that you
inquire about, this is the utility to use. (There are other keyboard
mapping functions available in fluxbox, but these mostly provide
command shortcuts, and not keyboard key mapping. If this is what you
are looking for, read the fluxbox-keys(5) man page.)
If you place your xmodmap(1) key mappings in your $HOME/.Xmodmap file,
then you should get your proper key mappings when
a) you select fluxbox from the GDM/KDM/SSDM/XDM login screen, and
b) you startfluxbox(1) from the commandline
HTH
In my .Xmodmap file I have two lines:
clear lock
keycode 66 = Control_L

It's been so long since I last set this I don't remeber what the Control_L is.

Thanks for responding.
root
2023-06-04 00:00:05 UTC
Permalink
Post by root
It seems to me that ClickFocus is set. When I started using Fluxbox
I thought there was a clickable menu I could bring up to change
the configuration on the fly, but now I can't seem to get such a menu.
I middle click on the toolbar but only a few things come up.
I found out why I can't see the clickable menu. This computer uses an
NVidia card with two independent HDMI outputs. The screen I normally look
at is set to display the upper left corner of a 4K display. The clickable
menu appears on the 4K screen. That menu confirms I have set Click Focus.
Rich
2023-06-03 17:50:47 UTC
Permalink
Secondly, over the years I have wanted to either defeat CapsLock or
change it to Control when running under X. None of the remedies that
have been suggested to me have proved to be permanent. They work for
a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?
Yes. Obtain a keyboard that allows you to swap the capslock and
control keys on the keyboard itself, such that the attached computers
are unaware anything has happened.

I.e., one such example keyboard is the legacy Northgate Omnikey
keyboard. There is a DIP switch on the keyboard, one of the switches
swaps capslock and control.:

https://www.ebay.com/sch/i.html?_nkw=northgate+omnikey

There may be other keyboards that can also swap those two, this one
happens to be the one that I know that can do so.
root
2023-06-03 22:28:34 UTC
Permalink
Post by Rich
Secondly, over the years I have wanted to either defeat CapsLock or
change it to Control when running under X. None of the remedies that
have been suggested to me have proved to be permanent. They work for
a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?
Yes. Obtain a keyboard that allows you to swap the capslock and
control keys on the keyboard itself, such that the attached computers
are unaware anything has happened.
I.e., one such example keyboard is the legacy Northgate Omnikey
keyboard. There is a DIP switch on the keyboard, one of the switches
https://www.ebay.com/sch/i.html?_nkw=northgate+omnikey
There may be other keyboards that can also swap those two, this one
happens to be the one that I know that can do so.
Thanks Rich, but I couldn't live without my IBM Model-M keyboard.
Proof of that I really do have a closet full of them (yardsale trophies).
Rich
2023-06-04 01:45:41 UTC
Permalink
Post by root
Post by Rich
Secondly, over the years I have wanted to either defeat CapsLock or
change it to Control when running under X. None of the remedies that
have been suggested to me have proved to be permanent. They work for
a while, and then X reverts back to the damned CapsLock.
Is there an absolutely permanent fix?
Yes. Obtain a keyboard that allows you to swap the capslock and
control keys on the keyboard itself, such that the attached computers
are unaware anything has happened.
I.e., one such example keyboard is the legacy Northgate Omnikey
keyboard. There is a DIP switch on the keyboard, one of the switches
https://www.ebay.com/sch/i.html?_nkw=northgate+omnikey
There may be other keyboards that can also swap those two, this one
happens to be the one that I know that can do so.
Thanks Rich, but I couldn't live without my IBM Model-M keyboard.
Proof of that I really do have a closet full of them (yardsale trophies).
The Northgate Omnikey's are close to the model M in typing feel. Not
identical, but a reasonable substitute. So your next option is to get
yourself a little ARM microcontroller and build a keyboard controller
for a spare model M that swaps the two keys around for you. Actually,
you might as well make it fully reprogrammable while you are at it.
root
2023-06-04 17:39:55 UTC
Permalink
Post by Rich
The Northgate Omnikey's are close to the model M in typing feel. Not
identical, but a reasonable substitute. So your next option is to get
yourself a little ARM microcontroller and build a keyboard controller
for a spare model M that swaps the two keys around for you. Actually,
you might as well make it fully reprogrammable while you are at it.
I stuck a command in .bash_profile:
xmodmap -e "remove lock = Caps_Lock"

Which, so far, seems to do the trick at the cost of
notifying me I have no display when a terminal is started
in console mode.

It's been a while since I opened an M keyboard up and I'm not
sure there would be space for anything inside, or whether
I could insert teh ARM unit between the keys and the output
cable.

Thanks again Rich.
Rich
2023-06-04 20:55:47 UTC
Permalink
Post by root
Post by Rich
The Northgate Omnikey's are close to the model M in typing feel.
Not identical, but a reasonable substitute. So your next option is
to get yourself a little ARM microcontroller and build a keyboard
controller for a spare model M that swaps the two keys around for
you. Actually, you might as well make it fully reprogrammable while
you are at it.
xmodmap -e "remove lock = Caps_Lock"
Which, so far, seems to do the trick at the cost of
notifying me I have no display when a terminal is started
in console mode.
Then use the proper bashism to check for a DISPLAY before you run it:

if [[ ${DISPLAY:-NONE} != "NONE" ]] ; then
xmodmap -e "remove lock = Caps_Lock"
fi

Do note that this does not move control to sit on capslock.
Post by root
It's been a while since I opened an M keyboard up and I'm not sure
there would be space for anything inside, or whether I could insert
teh ARM unit between the keys and the output cable.
Most likely there is lots of open space (an ATTiny is very small).

But if you are not normally into the hobby of replacing devices
existing controllers with your own custom controllers then even though
there is space, the amount of work is probaby too much.
root
2023-06-07 04:11:31 UTC
Permalink
Post by Rich
if [[ ${DISPLAY:-NONE} != "NONE" ]] ; then
xmodmap -e "remove lock = Caps_Lock"
fi
Do note that this does not move control to sit on capslock.
That did the trick. The Caps Lock is such a nuisance to me
I am happy to have it simply gone.
Post by Rich
Most likely there is lots of open space (an ATTiny is very small).
But if you are not normally into the hobby of replacing devices
existing controllers with your own custom controllers then even though
there is space, the amount of work is probaby too much.
Way back when I had to write controller software for all my keyboards.
In fact for everything else.
Rich
2023-06-07 12:40:47 UTC
Permalink
Post by root
Post by Rich
if [[ ${DISPLAY:-NONE} != "NONE" ]] ; then
xmodmap -e "remove lock = Caps_Lock"
fi
Do note that this does not move control to sit on capslock.
That did the trick. The Caps Lock is such a nuisance to me
I am happy to have it simply gone.
If it works for you just making it a dead key, then it works.
Post by root
Post by Rich
Most likely there is lots of open space (an ATTiny is very small).
But if you are not normally into the hobby of replacing devices
existing controllers with your own custom controllers then even
though there is space, the amount of work is probaby too much.
Way back when I had to write controller software for all my
keyboards. In fact for everything else.
Ok, so you /could/ retrofit one of your model M's.

Whether you care to expend the time and effort to do so is a very
different question.

Loading...