RE: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
SUN, Jian wrote: > I think I may turn to xtermcontrol and use commands to resize the > windows instead of key combinations. > xtermcontrol --maximize > xtermcontrol --restore If you're content to only have this available from the command line, you could assign the xtermcontrol commands to shortcut keys in your ~/.bashrc. E.g. to bind F1 to maximize and F2 to restore: bind '"\eOP":'$'"\201"'; bind -x $'"\201":xtermcontrol --maximize' bind '"\eOQ":'$'"\202"'; bind -x $'"\202":xtermcontrol --restore' You can't bind a shell command to a key that doesn't already feature in readline's map, so you have to translate the key (\eOP) into a non-existent key (\201) that is in its map, then bind the non- existent key to the command. > Thanks a lot for your help. I really appreciate it. No problem, glad to be of assistance, Phil This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.
Re: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
Dear Phil, Thanks a lot for your explanation. This question has bothered me for a looong time. Your code works fine on my computer. Following your instruction and some articles on the web, I adapted it to a "windows flavor" by adding the following codes in my ~/.XDefaults XTerm*metaSensEscape: true XTerm*VT100.Translations: "$ n": iconify() \n\ "$ m": maximize() \n\ "$ r": restore() \n\ However it caused problems and some keys could not work any more. (e.g. x n) I think I may turn to xtermcontrol and use commands to resize the windows instead of key combinations. xtermcontrol --maximize xtermcontrol --restore Thanks a lot for your help. I really appreciate it. On Mon, Mar 30, 2009 at 8:18 PM, Phil Betts wrote: > SUN, Jian wrote: >> Thanks a lot, do you mean that Exceed breaks X convenience and catches >> the key sequences? > > It's a few years since I tried Exceed's server, but IIRC that was one > of the problems I had. I had to tailor my .emacs to remap keys, but > because I only used Exceed at work, I got sick of trying to remember > which server I was using, and therefore which keystroke I could use, > and ditched Exceed as soon as XWin became stable enough. > >> So the standard XFree server's behavior is to pass the key sequence to >> the x applications and let them to decide what to do. Am i right? > > Yes > >> If so, how can I configure xterm or gnome-terminal to let them >> response to the ALt-Space key combination? I like this feature very >> much and it's also the default behavior of Gnome. > > The problem is that (in multiwindow mode), the window menu is a > _Windows_ menu; it's not an X window menu. I don't believe there is a > way to activate that from within an X application. However, you can > use translations in your ~/.Xdefaults to map keystrokes to minimize/ > maximize/restore. man xterm, and search for "translations" and > "ACTIONS". I'd advise against using alt-space (it's also used by > readline, and therefore by bash, as well as emacs). I would suggest > using the context menu key (usually next to Alt Gr), which, as a > fairly recent addition to keyboards is unlikely to be used by console > apps. E.g. something like this should work: > > XTerm*VT100.Translations: #override \n\ > Menu:maximize() \n\ > CtrlMenu:restore() \n\ > ShiftMenu:iconify() \n\ > MetaMenu:deiconify() > > I've not tested this, and it's several years since I needed to define > any translations, so if you don't understand how translations work, > you should read the documentation before trying this. > > The same technique should work with any Xt based X application. > >> Thanks a lot, >> SUN, Jian (Jason) >> On Mon, Mar 30, 2009 at 5:41 PM, Phil Betts > Please don't quote raw email addresses in your replies. They appear in > the archives on the web, and are therefore available to be harvested by > spammers. > > Phil > This email has been scanned by Ascribe PLC using Microsoft Antigen for > Exchange. > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
RE: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
SUN, Jian wrote: > Thanks a lot, do you mean that Exceed breaks X convenience and catches > the key sequences? It's a few years since I tried Exceed's server, but IIRC that was one of the problems I had. I had to tailor my .emacs to remap keys, but because I only used Exceed at work, I got sick of trying to remember which server I was using, and therefore which keystroke I could use, and ditched Exceed as soon as XWin became stable enough. > So the standard XFree server's behavior is to pass the key sequence to > the x applications and let them to decide what to do. Am i right? Yes > If so, how can I configure xterm or gnome-terminal to let them > response to the ALt-Space key combination? I like this feature very > much and it's also the default behavior of Gnome. The problem is that (in multiwindow mode), the window menu is a _Windows_ menu; it's not an X window menu. I don't believe there is a way to activate that from within an X application. However, you can use translations in your ~/.Xdefaults to map keystrokes to minimize/ maximize/restore. man xterm, and search for "translations" and "ACTIONS". I'd advise against using alt-space (it's also used by readline, and therefore by bash, as well as emacs). I would suggest using the context menu key (usually next to Alt Gr), which, as a fairly recent addition to keyboards is unlikely to be used by console apps. E.g. something like this should work: XTerm*VT100.Translations: #override \n\ Menu:maximize() \n\ CtrlMenu:restore() \n\ ShiftMenu:iconify() \n\ MetaMenu:deiconify() I've not tested this, and it's several years since I needed to define any translations, so if you don't understand how translations work, you should read the documentation before trying this. The same technique should work with any Xt based X application. > Thanks a lot, > SUN, Jian (Jason) > On Mon, Mar 30, 2009 at 5:41 PM, Phil Betts Please don't quote raw email addresses in your replies. They appear in the archives on the web, and are therefore available to be harvested by spammers. Phil This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.
Re: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
Dear Phil, Thanks a lot, do you mean that Exceed breaks X convenience and catches the key sequences? So the standard XFree server's behavior is to pass the key sequence to the x applications and let them to decide what to do. Am i right? If so, how can I configure xterm or gnome-terminal to let them response to the ALt-Space key combination? I like this feature very much and it's also the default behavior of Gnome. Thanks a lot, SUN, Jian (Jason) On Mon, Mar 30, 2009 at 5:41 PM, Phil Betts wrote: > SUN, Jian wrote: >> I am very sorry because I made a mistake. It's actually the key >> combination "Alt-Space" that does not work on my computer I want >> to use it to active the x-window's menu and then I cam press "x" to >> maximize the window. "Alt-space" does not work under cygwin xserver >> but works under Exceed's xserver. Is there anyway to enable it under >> cygwin xserver? > > Alt-space is used by emacs at least, so any X server that intercepts > that keystroke is breaking emacs. For the record, ctrl-space is also > used by emacs. Both keys work as expected (i.e. emacs sees them). > > I rejected Exceed's server because they seemed to be more concerned > with making it Windows-user friendly than a good (i.e. standard) X > server. You shouldn't have to change the way you work with X apps > depending on which OS you're connecting from. > > X is by no means the only application that doesn't support alt-space > as a shortcut for the window menu. Any terminal emulator will also > pass that key combination to the client application as well (if it > didn't, it would be broken). > > Phil > > This email has been scanned by Ascribe PLC using Microsoft Antigen for > Exchange. > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
RE: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
SUN, Jian wrote: > I am very sorry because I made a mistake. It's actually the key > combination "Alt-Space" that does not work on my computer I want > to use it to active the x-window's menu and then I cam press "x" to > maximize the window. "Alt-space" does not work under cygwin xserver > but works under Exceed's xserver. Is there anyway to enable it under > cygwin xserver? Alt-space is used by emacs at least, so any X server that intercepts that keystroke is breaking emacs. For the record, ctrl-space is also used by emacs. Both keys work as expected (i.e. emacs sees them). I rejected Exceed's server because they seemed to be more concerned with making it Windows-user friendly than a good (i.e. standard) X server. You shouldn't have to change the way you work with X apps depending on which OS you're connecting from. X is by no means the only application that doesn't support alt-space as a shortcut for the window menu. Any terminal emulator will also pass that key combination to the client application as well (if it didn't, it would be broken). Phil This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.
Re: Re: Is there any way to make the key combination "Ctrl+Space" work under cygwin-XServer?
Thanks a lot, Thomas. I am very sorry because I made a mistake. It's actually the key combination "Alt-Space" that does not work on my computer I want to use it to active the x-window's menu and then I cam press "x" to maximize the window. "Alt-space" does not work under cygwin xserver but works under Exceed's xserver. Is there anyway to enable it under cygwin xserver? Thanks a lot, Jason On Mon, Mar 30, 2009 at 4:06 PM, Thomas Wolff wrote: > Hi, > Control-Space works fine and delivers NUL (0x00) by default. It depends on > the application to interpret it, though. Bash, e.g., just ignores it. > Type od -c > then Control-Space, Enter > to verify. > Regards, > Thomas > > > SUN, Jian wrote: > > is there anyone who knows the answer? > I asked this question twice but no answers. > > Thanks, > Jason > On Fri, Mar 27, 2009 at 5:30 PM, SUN, Jian wrote: > > > Dear All, > > Is there any way to make the x-windows response to the key combination > "Ctrl+Space"? I noticed it could not work when using the > cygwin-xserver, however it works fine under X-Win32 or Exceed x > servers. > > Is it my configuration error or cygwin-xserver does not have this feature? > > Thanks a lot, > Jason > > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/