easiest way to type accents, graves, and other interesting letters

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

easiest way to type accents, graves, and other interesting letters

PaulJohnson32gmail
I've seen people asking for a simple way to enter accents and graves,
and the discussion here goes off into a configuration of the keyboard
and the X server.  I think you are misleading people a little bit.

I'm here to remind users that reconfiguring to use COMPOSE is
unnecessary, at least if you don't need to enter special symbols very
frequently.  I need accents only occasionally, and I often forget how
this is done.  I learned this trick from a docuement that was called
"Lyx Programmer's Guide" (or similar name) that was, apparently, never
officially published with LyX.  I can't find it today.  But, while
googling, I've noticed the easy way is explained in the LyX wiki in
the bottom of this page:

http://wiki.lyx.org/LyX/LyxFunctions

To see an example, just open lyx and hit alt-x and it opens a small
function bar at the bottom of the LyX display.  In there, one can type
commands.  To test, type

accent-acute a

when you hit enter, you should see the character you want in the text.

Honestly, I don't think we should encourage users to try for the
compose key solution before we point out this much simpler way to get
accents and other symbols for nonEnglish language documents.


--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

rgheck
Paul Johnson wrote:

> I've seen people asking for a simple way to enter accents and graves,
> and the discussion here goes off into a configuration of the keyboard
> and the X server.  I think you are misleading people a little bit.
>
> I'm here to remind users that reconfiguring to use COMPOSE is
> unnecessary, at least if you don't need to enter special symbols very
> frequently.  I need accents only occasionally, and I often forget how
> this is done.  I learned this trick from a docuement that was called
> "Lyx Programmer's Guide" (or similar name) that was, apparently, never
> officially published with LyX.  I can't find it today.  But, while
> googling, I've noticed the easy way is explained in the LyX wiki in
> the bottom of this page:
>
> http://wiki.lyx.org/LyX/LyxFunctions
>
> To see an example, just open lyx and hit alt-x and it opens a small
> function bar at the bottom of the LyX display.  In there, one can type
> commands.  To test, type
>
> accent-acute a
>
> when you hit enter, you should see the character you want in the text.
>
>  
And note too that you can bind this to a key easily enough. I think
maybe Ctrl-' would be the obvious binding, if it's available.

Richard

Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

rgheck
In reply to this post by PaulJohnson32gmail

\bind "C-apostrophe" "accent-acute"
\bind "C-S-quotedbl" "accent-umlaut"

Note that, to get these to work, you may also need to change some
earlier bindings. In cua.bind, I had to change:
\bind "~S-M-quotedbl" "quote-insert single"
\bind "~S-C-quotedbl" "self-insert \""
to
\bind "M-quotedbl" "quote-insert single"
\bind "C-quotedbl" "self-insert \""
The "~S" means: Ignore the state of the shift key.

By the way, developers: Shouldn't the later declaration have overridden
the earlier one? That would be more intuitive.

Richard


Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

Abdelrazak Younes-2
rgheck wrote:

>
> \bind "C-apostrophe" "accent-acute"
> \bind "C-S-quotedbl" "accent-umlaut"
>
> Note that, to get these to work, you may also need to change some
> earlier bindings. In cua.bind, I had to change:
> \bind "~S-M-quotedbl"        "quote-insert single"
> \bind "~S-C-quotedbl"        "self-insert \""
> to
> \bind "M-quotedbl"        "quote-insert single"
> \bind "C-quotedbl"        "self-insert \""
> The "~S" means: Ignore the state of the shift key.

Could you commit those Richard?

Abdel.

Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

Jean-Marc Lasgouttes
Abdelrazak Younes <[hidden email]> writes:

> rgheck wrote:
>> Note that, to get these to work, you may also need to change some
>> earlier bindings. In cua.bind, I had to change:
>> \bind "~S-M-quotedbl"        "quote-insert single"
>> \bind "~S-C-quotedbl"        "self-insert \""
>> to
>> \bind "M-quotedbl"        "quote-insert single"
>> \bind "C-quotedbl"        "self-insert \""
>> The "~S" means: Ignore the state of the shift key.
>
> Could you commit those Richard?

Richard, why did you have to make this change? This should be correct.

JMarc
Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

G. Milde-2
In reply to this post by Abdelrazak Younes-2
On  5.02.08, Abdelrazak Younes wrote:

> rgheck wrote:
>> \bind "C-apostrophe" "accent-acute"
>> \bind "C-S-quotedbl" "accent-umlaut"
>> Note that, to get these to work, you may also need to change some earlier
>> bindings. In cua.bind, I had to change:
>> \bind "~S-M-quotedbl"        "quote-insert single"
>> \bind "~S-C-quotedbl"        "self-insert \""
>> to
>> \bind "M-quotedbl"        "quote-insert single"
>> \bind "C-quotedbl"        "self-insert \""
>> The "~S" means: Ignore the state of the shift key.

> Could you commit those Richard?

Please do not rush this through: On my German keyboard, the quotedbl (") is
above the number 2, i.e.

>> \bind "M-quotedbl"        "quote-insert single"
>> \bind "C-quotedbl"        "self-insert \""

would never be activated! How could I insert a verbatim " after these
changes?

Guenter
Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

rgheck
In reply to this post by Jean-Marc Lasgouttes
Jean-Marc Lasgouttes wrote:

> Abdelrazak Younes <[hidden email]> writes:
>
>  
>> rgheck wrote:
>>    
>>> Note that, to get these to work, you may also need to change some
>>> earlier bindings. In cua.bind, I had to change:
>>> \bind "~S-M-quotedbl"        "quote-insert single"
>>> \bind "~S-C-quotedbl"        "self-insert \""
>>> to
>>> \bind "M-quotedbl"        "quote-insert single"
>>> \bind "C-quotedbl"        "self-insert \""
>>> The "~S" means: Ignore the state of the shift key.
>>>      
>> Could you commit those Richard?
>>    
>
> Richard, why did you have to make this change? This should be correct.
>
>  
Yes, I agree, this looks like a bug. But try it this way:
\bind "~S-M-quotedbl" "quote-insert single"
\bind "~S-C-quotedbl" "self-insert \""
\bind "S-M-apostrophe" "accent-acute"
\bind "S-C-quotedbl" "accent-umlaut"
You can't make the accent work. But this does work:
\bind "M-apostrophe" "quote-insert single"
\bind "S-M-apostropher" "self-insert \""
\bind "C-apostrophe" "accent-acute"
\bind "S-C-quotedbl" "accent-umlaut"
I wonder if the problem isn't the "apostrophe" vs "quotedbl" bit somehow?

Richard

Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

rgheck
In reply to this post by G. Milde-2
G. Milde wrote:

> On  5.02.08, Abdelrazak Younes wrote:
>  
>> rgheck wrote:
>>    
>>> \bind "C-apostrophe" "accent-acute"
>>> \bind "C-S-quotedbl" "accent-umlaut"
>>> Note that, to get these to work, you may also need to change some earlier
>>> bindings. In cua.bind, I had to change:
>>> \bind "~S-M-quotedbl"        "quote-insert single"
>>> \bind "~S-C-quotedbl"        "self-insert \""
>>> to
>>> \bind "M-quotedbl"        "quote-insert single"
>>> \bind "C-quotedbl"        "self-insert \""
>>> The "~S" means: Ignore the state of the shift key.
>>>      
>
>  
>> Could you commit those Richard?
>>    
>
> Please do not rush this through: On my German keyboard, the quotedbl (") is
> above the number 2, i.e.
>
>  
>>> \bind "M-quotedbl"        "quote-insert single"
>>> \bind "C-quotedbl"        "self-insert \""
>>>      
>
> would never be activated! How could I insert a verbatim " after these
> changes?
>
>  
Nothing's being done immediately. Actually, it would help a lot if you
could play around with the changes that have been suggested, namely:
\bind "M-apostrophe" "quote-insert single"
\bind "S-M-quotedbl" "self-insert \""
\bind "C-apostrophe" "accent-acute"
\bind "S-C-quotedbl" "accent-umlaut"
As you may also have seen, we think there may be a bug here somewhere, too.

rh

Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

G. Milde-3
On  5.02.08, rgheck wrote:
> G. Milde wrote:

> Nothing's being done immediately. Actually, it would help a lot if you
> could play around with the changes that have been suggested, namely:

My experiences with Debian Gnu/Linux and German keyboard:

> \bind "M-apostrophe" "quote-insert single"
> \bind "C-apostrophe" "accent-acute"

Works with acute-accent (which is unshifted [´`] key) but not with the
apostrophe (shifted [#'] key), as on my system, pressing either
acute-accent or apostrophe actually sends the apostrophe (') char.

> \bind "S-M-quotedbl" "self-insert \""
> \bind "S-C-quotedbl" "accent-umlaut"

Works here as expected (however it will fail on keyboards that have " in
an unshifted position!).

> As you may also have seen, we think there may be a bug here somewhere, too.


I suppose I found the bug:

From http://wiki.lyx.org/Tips/KeyboardShortcuts

   Precedence of keyboard bindings
   -------------------------------
   
   Note that the latest key binding takes precedence, ...
   
   An exception are bindings using the modifier "~S", which doesnot overide
   other bindings. ...

However, bindings containing "~S" do also not overwrite earlier bindings
with the same specifier, i.e.

  \bind "S-M-quotedbl"   "self-insert"
  \bind "S-M-quotedbl"   "accent-umlaut"
 
will bind quotedbl to self-insert (regardless of the Shift state).

As cua.sl contains a "~S"-binding for quotedbl:
 
  \bind "~S-M-quotedbl" "quote-insert single"

the proposed bindings will not override this and hence not work.


The fix would (IMO) be

* let "~S"-bindings overrule earlier "~S"-bindings similar to "normal"
  bindings. (But keep the precedence of more specific bindings.)

* official documentation of the keybindings syntax


This would result in clear and flexible rules for precedence:

1. Bindings overwrite earlier bindings with equal specifier, e.g.

     \bind "~S-a" "foo"
     \bind "~S-a" "bar"
     
   will bind [A] and [a] to function "bar".

2. Specific bindings have higher precedence than more generic ones
   regardless of position, e.g.

     \bind "S-a"  "foo"
     \bind "~S-a" "bar"
     
   will bind [A] to "foo" (but [a] to "bar").


It would also allow keyboard-layout-ignorant binding definitions of the
accent-* functions.

OTOH, you can of course use the "~S" form already now if you uncomment or
remove conflicting earlier definitions...


BTW, my private gm.bind contains:

# accents (dead keys)
\bind "M-~S-asciicircum"   "accent-circumflex"   # also "M-m h"
\bind "M-~S-asciitilde"   "accent-tilde"        # also "M-m asciitilde"
\bind "M-~S-degree"     "accent-circle"       # °
\bind "M-~S-plus"   "accent-tilde" # ~ (AltGr-+ on German keyb.)
\bind "M-~S-quoteleft"   "accent-grave"        # `
\bind "M-~S-apostrophe"   "accent-acute"      # '
\bind "M-v"   "accent-caron"        # v = hacheck




Günter
Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

Helge Hafting-3
In reply to this post by G. Milde-2
G. Milde wrote:

> On  5.02.08, Abdelrazak Younes wrote:
>  
>> rgheck wrote:
>>    
>>> \bind "C-apostrophe" "accent-acute"
>>> \bind "C-S-quotedbl" "accent-umlaut"
>>> Note that, to get these to work, you may also need to change some earlier
>>> bindings. In cua.bind, I had to change:
>>> \bind "~S-M-quotedbl"        "quote-insert single"
>>> \bind "~S-C-quotedbl"        "self-insert \""
>>> to
>>> \bind "M-quotedbl"        "quote-insert single"
>>> \bind "C-quotedbl"        "self-insert \""
>>> The "~S" means: Ignore the state of the shift key.
>>>      
>
>  
>> Could you commit those Richard?
>>    
>
> Please do not rush this through: On my German keyboard, the quotedbl (") is
> above the number 2, i.e.
>
>  
>>> \bind "M-quotedbl"        "quote-insert single"
>>> \bind "C-quotedbl"        "self-insert \""
>>>      
>
> would never be activated! How could I insert a verbatim " after these
> changes?
>  
In general, be very careful about combining anything but a-z0-9.,
with shift or alt/meta.

Almost any of the other symbols might need a shift or an alt/meta or
a dead key sequence - depending on the keyboard language setup.

I need shift (and/or a dead-key sequence) in order to type these "^~
I need alt/meta in order to type these: @$[]{}
I do have single-keypress access to æøå though, so mapping
often-used editing functions to C-å or M-æ is no problem. ;-)

Helge Hafting


 


Reply | Threaded
Open this post in threaded view
|

Re: easiest way to type accents, graves, and other interesting letters

G. Milde-3
On 12.02.08, Helge Hafting wrote:
> G. Milde wrote:
>> On  5.02.08, Abdelrazak Younes wrote:
>>> rgheck wrote:

>>>> In cua.bind, I had to change:
>>>> \bind "~S-M-quotedbl"        "quote-insert single"
>>>> \bind "~S-C-quotedbl"        "self-insert \""
>>>> to
>>>> \bind "M-quotedbl"        "quote-insert single"
>>>> \bind "C-quotedbl"        "self-insert \""
>>>> The "~S" means: Ignore the state of the shift key.

> In general, be very careful about combining anything but a-z0-9.,
> with shift or alt/meta.

Some keyboard layouts have even 0-9 on shifted keys...

IMO, the rule for distributed *.bind files should be:

  Use "~S" for all characters that do not have a "shifted" alternative, i.e.
  no upcase/downcase pair.

However, a feature/bug in the current parsing of *.bind files needs to be
considered:

Inconsistent handling "~S"-bindings
-------------------------------------

Generally, the latest key binding takes precedence but bindings
containing "~S" do not overwrite earlier bindings.

I.e. in order to change a binding to a non-letter character, do e.g.
in a bind file::


  # keybindings special to this file, part I
  # (shift-ignorant bindings are not overridden in LyX <= 1.5.3)
  \bind "~S-M-quotedbl"        "quote-insert single"
 
  # input pre-defined keybinding sets
  \bind_file cua.bind #   KDE-, Windows-, Mac- and Motif-like bindings
  \bind_file de_menus.bind # German version
 
  # keybindings special to this file, part II
 
  # missing in cua.bind
  # Mark buffer
  \bind "C-a"     "command-sequence buffer-begin; buffer-end-select"
  # Go to next open buffer (overwritten in math.bind)
  \bind "C-Tab"          "buffer-next"


However, fixing this oddity would still be my favourite option.

Günter