[comp.windows.x] Keyboardless twm

doug@key.COM (Douglas N. Good) (03/31/89)

Several days ago someone posted an article which described a problem
that I have been having.  I have yet to see a response (maybe I missed
it) so I'll pose the question again.

When using twm, I am not able to get a response from keyboard input
Mouse input works fine and windows raise/lower/iconify/etc. as expected;
however, when I type something, the raised window fails to recognize it.
I have had minor success with xterm.  If I select "Secure Keyboard" I
can send input to the secured xterm but this certainly isn't the way
it's supposed to work

Could someone who's solved this problem please mail or post the solution?

Many thanks,
Doug


============================
Doug Good
Amdahl Corporation, Key Computer Laboratories
...!pacbell!key!doug   ||   doug@key.com
-- 
============================
Doug Good
Amdahl Corporation, Key Computer Laboratories
...!pacbell!key!doug   ||   doug@key.com

rcb@cccvs1.ncsu.edu (Randy Buckland) (03/31/89)

In article <732@key.COM> doug@cygnus.key.COM (Douglas N. Good) writes:
>
>Several days ago someone posted an article which described a problem
>that I have been having.  I have yet to see a response (maybe I missed
>it) so I'll pose the question again.
>
>When using twm, I am not able to get a response from keyboard input
>Mouse input works fine and windows raise/lower/iconify/etc. as expected;
>however, when I type something, the raised window fails to recognize it.
>I have had minor success with xterm.  If I select "Secure Keyboard" I
>can send input to the secured xterm but this certainly isn't the way
>it's supposed to work

I had this same problem when I upgraded to V5.x. I eventually found that
the problem was caused by the sample .twmrc file distributed with
the code. I don't know which command was causing the problem, but I 
simply defined a simple .twmrc with just a main options menu with a few
useful options and restarted twm and everything looked fine. Then just
add the functions you want and that should work.

Randy Buckland
rcb@ncsuvx.ncsu.edu

geek@mit-amt (Chris Schmandt) (04/01/89)

>When using twm, I am not able to get a response from keyboard input
>Mouse input works fine and windows raise/lower/iconify/etc. as expected;
>however, when I type something, the raised window fails to recognize it.

Do you define a non-existent key in your .twmrc?  For example, I don't
like the placement of the function keys on my 386i keyboard, and wanted
to disable them.  So I put in a line like:
"F1"    :window   :f.nop

This is fine.  BUT, if a take a .twmrc re-defining F10 so, which
works fine on a 386i, and use it on a Sun 3/60, which has no F10
key, gonzo, same symptoms you describe.

This bug was dissected and a patch posted to this news group some
months ago.

chris

kucharsk@uts.amdahl.com (William Kucharski) (04/01/89)

I believe this problem is common to the sample .twmrc distributed in the
source.  I recently noticed this same problem in the sample .twmrc given
on a Solbourne Series4/600.

Using a simple .twmrc solves the problem, though.

					Bill
-- 
					William Kucharski

ARPA: kucharsk@uts.amdahl.com
UUCP: ...!{ames,decwrl,sun,uunet}!amdahl!kucharsk

Disclaimer:  The opinions expressed above are my own, and may not agree with
	     those of any other sentient being, not to mention those of my 
	     employer.  So there.

toml@hpfcdq.HP.COM (Tom LaStrange) (04/01/89)

>>When using twm, I am not able to get a response from keyboard input
>>Mouse input works fine and windows raise/lower/iconify/etc. as expected;
>>however, when I type something, the raised window fails to recognize it.
>
>This bug was dissected and a patch posted to this news group some
>months ago.

Here it is again.

--
Tom LaStrange

Hewlett Packard Co.               ARPA: toml%hpfcla@hplabs.hp.com
Graphics Technology Division      UUCP: hplabs!hpfcla!toml
Fort Collins, CO

-------------------------------------------------
*** /tmp/,RCSt1a00790	Wed Nov  9 01:20:05 1988
--- menus.c	Wed Nov  9 01:20:11 1988
***************
*** 137,144 ****
  {
      FuncKey *tmp;
      KeySym keysym;
  
!     if ((keysym = XStringToKeysym(name)) == NoSymbol)
      {
  	fprintf(stderr, "twm: unknown key name \"%s\"\n", name);
  	return;
--- 137,150 ----
  {
      FuncKey *tmp;
      KeySym keysym;
+     KeyCode keycode;
  
!     /*
!      * Don't let a 0 keycode go through, since that means AnyKey to the
!      * XGrabKey call in GrabKeys().
!      */
!     if ((keysym = XStringToKeysym(name)) == NoSymbol ||
! 	(keycode = XKeysymToKeycode(dpy, keysym)) == 0)
      {
  	fprintf(stderr, "twm: unknown key name \"%s\"\n", name);
  	return;
***************
*** 162,168 ****
  
      tmp->name = name;
      tmp->keysym = keysym;
!     tmp->keycode = XKeysymToKeycode(dpy, keysym);
      tmp->cont = cont;
      tmp->mods = mods;
      tmp->func = func;
--- 168,174 ----
  
      tmp->name = name;
      tmp->keysym = keysym;
!     tmp->keycode = keycode;
      tmp->cont = cont;
      tmp->mods = mods;
      tmp->func = func;