all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Alt+numpad to write special symbols
@ 2009-09-29  0:49 David Capello
  2009-09-29  0:57 ` Juanma Barranquero
  0 siblings, 1 reply; 6+ messages in thread
From: David Capello @ 2009-09-29  0:49 UTC (permalink / raw)
  To: emacs-devel

Is there a way to use Alt+numpad to write Unicode
characters in Emacs? Or does it need a patch?
Have someone tried it before?

If there are not a way to pass Alt+numpad keys to OS directly,
I could write a patch for w32. Is someone interested too? Some
suggestion to do this? (maybe a name for a global variable to
customize this behavior, like w32-ignore-alt-numpad, etc.)

Sorry if this mailing list is not the right place to ask this.

More info:
http://en.wikipedia.org/wiki/Windows_Alt_Keycodes




^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Fwd: Alt+numpad to write special symbols
@ 2009-09-30  1:40 MON KEY
  0 siblings, 0 replies; 6+ messages in thread
From: MON KEY @ 2009-09-30  1:40 UTC (permalink / raw)
  To: juri; +Cc: emacs-devel

> Like in GTK+ `Ctrl+Shift+U hex RET' http://en.wikipedia.org/wiki/Unicode_input
> we could finish entering the number with RET, e.g. `M-2 M-7 M-0 M-f RET'.
> Or expect a fixed-length four-digit number `M-2 M-7 M-0 M-f' where the last
> fourth digit finishes the sequence.  In any case, your up/down events code
> would be useful for other purposes as well.

If I understand correctly what the goal is re: hex input and Unicode,
following was written to accomplish just such task:

(defun mon-test-keypresses (&optional first second third)
  "Used to test if additional optional args have been passed to interactive.\n
EXAMPLE:\nM-34 M-x mon-test-keypresses\n
=> \(\(meta . 51\) \(meta . 52\) \(meta . 120\) mon-test-keypresses\)\n►►►"
  (interactive "P\nP\np")
  (let ((accum-string '())
	(accum-event '())
	(self 'mon-test-keypresses))
    (mapc (lambda (x)
            (cond ((= x 13) nil)
                  ((or (eql (car (event-modifiers x)) 'meta)
                       (eql (car (event-modifiers x)) 'control))
                   (setq accum-event (cons (cons (car (event-modifiers
x)) (event-basic-type x)) accum-event)))
                  (t (setq accum-string (cons (char-to-string
(event-basic-type x)) accum-string)))))
          (this-command-keys-vector))
    (setq accum-event (reverse accum-event))
    (setq accum-string (reverse accum-string))
    (setq accum-string (apply 'concat accum-string))
    (setq accum-string `(,@accum-event ,(if (string= accum-string
self) self accum-string)))
        (prin1 accum-string)))

s_P




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

end of thread, other threads:[~2009-09-30  1:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29  0:49 Alt+numpad to write special symbols David Capello
2009-09-29  0:57 ` Juanma Barranquero
     [not found]   ` <77b6ce390909281815j1600f85by5837ca2bb4b1f7d@mail.gmail.com>
2009-09-29  1:27     ` Fwd: " David Capello
2009-09-29  3:13       ` Stefan Monnier
2009-09-29 23:12         ` Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2009-09-30  1:40 MON KEY

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.