unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Print key
@ 2004-06-16 10:50 John Robot
  2004-06-16 16:23 ` Kevin Rodgers
  2004-06-17  5:56 ` Jason Rumney
  0 siblings, 2 replies; 11+ messages in thread
From: John Robot @ 2004-06-16 10:50 UTC (permalink / raw)


Hi,

How is it possible to map the "Print Screen" key of a keyboard
(under Emacs 21.3, on Win XP) to the print function?

I've tried "everything", but with no success...

    (global-set-key [(print)] 'ps-print-buffer-with-faces)

Help is welcome!

Best regards,
  John

-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-16 10:50 Print key John Robot
@ 2004-06-16 16:23 ` Kevin Rodgers
  2004-06-16 16:37   ` John Robot
  2004-06-17  5:56 ` Jason Rumney
  1 sibling, 1 reply; 11+ messages in thread
From: Kevin Rodgers @ 2004-06-16 16:23 UTC (permalink / raw)


John Robot wrote:
 > How is it possible to map the "Print Screen" key of a keyboard
 > (under Emacs 21.3, on Win XP) to the print function?
 >
 > I've tried "everything", but with no success...
 >
 >     (global-set-key [(print)] 'ps-print-buffer-with-faces)

`C-h v' followed by the Print Screen key on GNU Emacs 21.3.1
(i386-pc-solaris2.7, X toolkit) says "<print> is undefined".  So you
should use (kbd "<print>") instead of [(print)].

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-16 16:23 ` Kevin Rodgers
@ 2004-06-16 16:37   ` John Robot
  2004-06-17  2:50     ` Bruce Ingalls
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: John Robot @ 2004-06-16 16:37 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:
> John Robot wrote:
>  > How is it possible to map the "Print Screen" key of a keyboard
>  > (under Emacs 21.3, on Win XP) to the print function?
>
> `C-h v' followed by the Print Screen key on GNU Emacs 21.3.1
> (i386-pc-solaris2.7, X toolkit) says "<print> is undefined".  So you
> should use (kbd "<print>") instead of [(print)].

(global-set-key (kbd "<print>") 'ps-print-buffer-with-faces)

does not work either...

And `C-h k' does not print anything in the mini-buffer, as if
hitting the key did not function (it does function, though, in
all the other applications I'm using).

Best regards,
  John
-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-16 16:37   ` John Robot
@ 2004-06-17  2:50     ` Bruce Ingalls
  2004-06-17  7:46       ` John Robot
  2004-06-30 15:43     ` Kai Grossjohann
       [not found]     ` <mailman.2831.1088610753.1953.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 11+ messages in thread
From: Bruce Ingalls @ 2004-06-17  2:50 UTC (permalink / raw)


;;Does the following help?

(define-key function-key-map [f22] [print]) ;display f22 as print screen
(global-set-key [print] 'ps-print-buffer-with-faces)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-16 10:50 Print key John Robot
  2004-06-16 16:23 ` Kevin Rodgers
@ 2004-06-17  5:56 ` Jason Rumney
  2004-06-17  7:40   ` John Robot
  1 sibling, 1 reply; 11+ messages in thread
From: Jason Rumney @ 2004-06-17  5:56 UTC (permalink / raw)


John Robot <john.robot@laposte.net> writes:

> Hi,
>
> How is it possible to map the "Print Screen" key of a keyboard
> (under Emacs 21.3, on Win XP) to the print function?
>
> I've tried "everything", but with no success...
>
>     (global-set-key [(print)] 'ps-print-buffer-with-faces)

What does C-h k say?

On windows, that key seems to be called "snapshot" rather than "print".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-17  5:56 ` Jason Rumney
@ 2004-06-17  7:40   ` John Robot
  2004-06-20  9:42     ` Jason Rumney
  0 siblings, 1 reply; 11+ messages in thread
From: John Robot @ 2004-06-17  7:40 UTC (permalink / raw)


jasonr (Jason Rumney) @  f2s.com writes:
> John Robot <john.robot@laposte.net> writes:
>
>> How is it possible to map the "Print Screen" key of a keyboard
>> (under Emacs 21.3, on Win XP) to the print function?
>>
>>     (global-set-key [(print)] 'ps-print-buffer-with-faces)
>
> What does C-h k say?

Nothing. `describe-key' does not "see" the `Print Screen' key;
it does not display anything, still waiting for an input key...


> On windows, that key seems to be called "snapshot" rather than "print".

Nope. Does not help ;-(

Best regards,
  John

-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-17  2:50     ` Bruce Ingalls
@ 2004-06-17  7:46       ` John Robot
  0 siblings, 0 replies; 11+ messages in thread
From: John Robot @ 2004-06-17  7:46 UTC (permalink / raw)


Bruce Ingalls <ingallsb@verizon._NO.SPAM_.net> writes:

> ;;Does the following help?
>
> (define-key function-key-map [f22] [print]) ;display f22 as print screen
> (global-set-key [print] 'ps-print-buffer-with-faces)

No. Still the same problem: hitting the `Print Screen' key does
not generate any activity...

Thanks for the try, still.

Best regards,
  John

-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-17  7:40   ` John Robot
@ 2004-06-20  9:42     ` Jason Rumney
  2004-06-21 10:10       ` John Robot
  0 siblings, 1 reply; 11+ messages in thread
From: Jason Rumney @ 2004-06-20  9:42 UTC (permalink / raw)


John Robot <john.robot@laposte.net> writes:

> jasonr (Jason Rumney) @  f2s.com writes:

>> What does C-h k say?
>
> Nothing. `describe-key' does not "see" the `Print Screen' key;
> it does not display anything, still waiting for an input key...

"Print Screen" is globally used by Windows as a hotkey (it puts a
screen snapshot on the clipboard). To override this, you need to get
Emacs to re-register it:

(w32-register-hot-key [snapshot])

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-20  9:42     ` Jason Rumney
@ 2004-06-21 10:10       ` John Robot
  0 siblings, 0 replies; 11+ messages in thread
From: John Robot @ 2004-06-21 10:10 UTC (permalink / raw)


jasonr (Jason Rumney) @  f2s.com writes:
> John Robot <john.robot@laposte.net> writes:
>> jasonr (Jason Rumney) @  f2s.com writes:
>
>>> What does C-h k say?
>>
>> Nothing. `describe-key' does not "see" the `Print Screen' key;
>> it does not display anything, still waiting for an input key...
>
> "Print Screen" is globally used by Windows as a hotkey (it puts a
> screen snapshot on the clipboard). To override this, you need to get
> Emacs to re-register it:
>
> (w32-register-hot-key [snapshot])

Yeah!  The following code is now *perfectly* working:

(w32-register-hot-key [snapshot])
(global-set-key [(snapshot)] 'ps-print-buffer-with-faces)

Many thanks for your help!

Best regards,
  John

-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
  2004-06-16 16:37   ` John Robot
  2004-06-17  2:50     ` Bruce Ingalls
@ 2004-06-30 15:43     ` Kai Grossjohann
       [not found]     ` <mailman.2831.1088610753.1953.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 11+ messages in thread
From: Kai Grossjohann @ 2004-06-30 15:43 UTC (permalink / raw)


John Robot <john.robot@laposte.net> writes:

> And `C-h k' does not print anything in the mini-buffer, as if
> hitting the key did not function (it does function, though, in
> all the other applications I'm using).

It seems that something is eating the key before Emacs sees it.  To
check for sure, hit x then PrintScreen, then y.  Then C-h l.  Is
there something between x and y?

Kai

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Print key
       [not found]     ` <mailman.2831.1088610753.1953.help-gnu-emacs@gnu.org>
@ 2004-07-02 14:43       ` Fabrice Niessen
  0 siblings, 0 replies; 11+ messages in thread
From: Fabrice Niessen @ 2004-07-02 14:43 UTC (permalink / raw)


Kai Grossjohann <kai@emptydomain.de> writes:

> John Robot <john.robot@laposte.net> writes:
>
>> And `C-h k' does not print anything in the mini-buffer, as if
>> hitting the key did not function (it does function, though, in
>> all the other applications I'm using).
>
> It seems that something is eating the key before Emacs sees it.  To
> check for sure, hit x then PrintScreen, then y.  Then C-h l.  Is
> there something between x and y?

Good idea... Yes, there is `<snapshot>' between `x' and `y'.

But, anyway, my problem is now resolved* thanks to Jason Rumney
and the command:

    (w32-register-hot-key [snapshot])

before my key binding:

    (global-set-key [(snapshot)] 'ps-print-buffer-with-faces)

Best regards,
  John

* except in XEmacs where the function `w32-register-hot-key'
  does not work

-- 
John Robot

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-07-02 14:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-16 10:50 Print key John Robot
2004-06-16 16:23 ` Kevin Rodgers
2004-06-16 16:37   ` John Robot
2004-06-17  2:50     ` Bruce Ingalls
2004-06-17  7:46       ` John Robot
2004-06-30 15:43     ` Kai Grossjohann
     [not found]     ` <mailman.2831.1088610753.1953.help-gnu-emacs@gnu.org>
2004-07-02 14:43       ` Fabrice Niessen
2004-06-17  5:56 ` Jason Rumney
2004-06-17  7:40   ` John Robot
2004-06-20  9:42     ` Jason Rumney
2004-06-21 10:10       ` John Robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).