Subject: FVWM: key mapping and Xemacs

From: Henry McNair <[email-masked]>
Date: Wed, 21 Mar 2001 17:48:05 -0800 (PST)

Hello:
I am trying to set up key binding in my .emacs file that would
override the key assignment in my .fvwm2rc file. However, the
emacs bindings do not work when I am in an emacs window. It
is as if the key bindings in the .fvwr2rc file have presidence
for every window. The only happens for the keys that have bindings
in both init files. Those keys that are not in conflict work as
I would expect.

Is there anyway I can get the emacs key bindings to work when the
mouse pointer is in an emacs window, but have the .fvwm2rc key
bindings work when the pointer is not in an emacs window?

-------------------------------------------------------------------
Henry McNair                               [email-masked]
Hewlett-Packard 
11000 Wolfe Road, MS-42UD                  (408)447-1967 - voice
Cupertino, CA 95014                        (408)447-4924 - FAX
-------------------------------------------------------------------

In my .fvwm2rc file I have the following mapping for the function keys
# Keyboard accelerators
Key F1		A	A	RaiseLower
Key F2		A	A	Move
Key F3		A	A	Resize
Key F4		A	A	Stick
Key F5		A	A	Iconify
Key F6		A	A	Popup "Window-Ops"
Key F7		A	A	Module FvwmWinList 
Key F8		A	A	Destroy

In my .emacs file, I have the following key binding when I
am using Xemacs (version 21.1).

(global-set-key [f4] 'save-buffer)
(global-set-key [f5] 'find-file)
(global-set-key [f6] 'switch-to-buffer)
(global-set-key [f7] 'recenter)
(global-set-key [f8] 'find-alternate-file-current-line)
(global-set-key [f9] 'other-window)
(global-set-key [f10] 'delete-window)
(global-set-key [f11] 'delete-other-windows)
(global-set-key [f12] 'split-window-vertically)
(global-set-key [insert] 'beginning-of-line)
(global-set-key [delete] 'end-of-line)
(global-set-key [print] 'kill-line)
(global-set-key [home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-buffer)
(global-set-key [page up] 'scroll-up)
(global-set-key [page down] 'scroll-down)

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 22 Mar 2001 04:10:39 +0100

On Wed, Mar 21, 2001 at 05:48:05PM -0800, Henry McNair wrote:
> for every window.

Yes.  The window manager keyboard grabs always take prcedence over
the application's grabs.

> The only happens for the keys that have bindings

Only as a dirty hack.  You could program a trigger for FvwmEvent
that disables said key bindings when the pointer enters an xemacs
window and restores the bindings when the pointer leaves it:

  *FvwmEvent focus_change focus_change_func

  AddToFunc focus_change_func
  + I current (emacs) disable_bindings_func
  + I current (!emacs) enable_bindings_func

  AddToFunc enable_bindings_func
  + I Key F1 W M GotoPage 0 0
  + I Key F2 W M GotoPage 1 0

  AddToFunc disable_bindings_func
  + I Key F1 W M -
  + I Key F2 W M -

Then add "Module FvwmEvent" to your InitFunction and
RestartFunction.

(completely untested).

However, if there are many bindings you want to share, this may
slow down things a lot because it applies to all windows, not
just XEmacs.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].