From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?6YOt5pmT5bOw?= Newsgroups: gmane.emacs.help Subject: Re: Different scan code behavior in X and console Date: Sat, 14 Jan 2012 23:51:32 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326613906 22198 80.91.229.12 (15 Jan 2012 07:51:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 15 Jan 2012 07:51:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 15 08:51:42 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RmKsP-0005So-Ab for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Jan 2012 08:51:41 +0100 Original-Received: from localhost ([::1]:54178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmKsO-0000zY-EB for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Jan 2012 02:51:40 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmKsJ-0000zK-3v for help-gnu-emacs@gnu.org; Sun, 15 Jan 2012 02:51:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmKsI-00012n-0a for help-gnu-emacs@gnu.org; Sun, 15 Jan 2012 02:51:35 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:46006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmKsH-00012g-Na for help-gnu-emacs@gnu.org; Sun, 15 Jan 2012 02:51:33 -0500 Original-Received: by iacb35 with SMTP id b35so366338iac.0 for ; Sat, 14 Jan 2012 23:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=IU1xirhnzo1a/h1EAuKZIlFg0s+BsTszB0My3cyM15M=; b=naUhRNSrg30PmMu6djwUsXnKdaOJzk5kV0AaKoRQvTw45dvK/6IyV3V1dw4Fn30oNe e4nt4B9pxpQNvNPTJxk+8UVSINWtG4THTGN+AZJ+kXATs05w5a0ouO2SdXnk67vzsHdz PzYpb2JBrcoOhTRtZxnsYg5p5U+QY1e6L9W9U= Original-Received: by 10.50.88.230 with SMTP id bj6mr7666534igb.26.1326613892599; Sat, 14 Jan 2012 23:51:32 -0800 (PST) Original-Received: by 10.42.239.70 with HTTP; Sat, 14 Jan 2012 23:51:32 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83508 Archived-At: OK, Just found Ctrl-PgDn (and similar keys) are filtered by Mac & Windows, it works for Linux. So please skip this question. I'll keep trying to enable CUA mode in emacs later. Will post my questions later if still have problems. Sorry to bother. Best Regards, Lamu Guo On Sat, Jan 14, 2012 at 5:14 PM, =E9=83=AD=E6=99=93=E5=B3=B0 wrote: > Forward a mail I just sent to linux-console@ > > Any idea on this? If this problem can be resolved, I pretty sure CUA > can be enabled in console mode, including ssh pts. > > > ---------- Forwarded message ---------- > From: > Date: Sat, Jan 14, 2012 at 4:52 PM > Subject: Different scan code behavior in X and console > To: linux-console@vger.kernel.org > > > Hi there, > > Sorry to bother. Not sure whether it is correct to post this question > to the mail list, but can't find a suitable linux console user mail > list for discussing this. If you have good mail list to suggest, > please help me to forward. Thanks! > > The question is: I tried to make my emacs have the same key response > on both X and console (ssh pts). However, I can't find scan code for > "Ctrl-PageDown" in console mode. I attached the code for testing the > scan code, and below is different behavior in X and console: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D X =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > Press a Key 338 =C2=A0 // Just type > Press a Key 27 > Press a Key 91 > Press a Key 54 > Press a Key 59 > Press a Key 53 > Press a Key 126 =C2=A0// 6-chars for > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Console =3D=3D=3D=3D=3D=3D=3D=3D=3D > Press a Key 338 =C2=A0// Same for > Press a Key =C2=A0 =C2=A0 =C2=A0 =C2=A0 // No response for > > Any idea on this? Greatly appreciate your replies, your suggested > readings, and so on! > > Best Regards, > Lamu Guo > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DBelow is text of the code, for eas= ily reading to skip > attachment=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > #include > #include > #include > > int main(void) > { > =C2=A0WINDOW *_window =3D initscr(); > =C2=A0int _rows; > =C2=A0int _cols; > > =C2=A0cbreak(); > > =C2=A0/* Accept all keys */ > =C2=A0keypad(_window, true); > > =C2=A0/* Don't echo things that are typed */ > =C2=A0noecho(); > > =C2=A0/* Get the screen dimensions */ > =C2=A0getmaxyx(_window, _rows, _cols); > > =C2=A0/* Don't display cursor */ > =C2=A0curs_set(0); > > =C2=A0for (;;) > =C2=A0{ > =C2=A0 =C2=A0printw("Press a Key "); > =C2=A0 =C2=A0refresh(); > =C2=A0 =C2=A0int key =3D wgetch(_window); > =C2=A0 =C2=A0printw("%d \n", key); > =C2=A0} > > =C2=A0endwin(); > > =C2=A0return 0; > }