14

I have a Spanish layout keyboard (in Snow Leopard). Whenever I use the dot, or comma, in the numeric keyboad (right of the 0) it always shows a comma, but I'd prefer if it entered a dot, just like PCs do. Otherways, entering IP addresses, or decimal numbers when coding is a PITA. How can I do that?

I have tried altering my regional settings so that the decimal separator is a point and the thousands separator is a comma, but that doesn't seem to affect text entry.

I'd prefer changing some regional setting rather than remapping the keyboard, but I'll accept any answer that works - short of changing the regional layout of the keyboard, I really need my diacritics there.

2
  • I prefer to keep the title as I originally intended. I don't want to disable it, just configure it differently, and possibly use a modifier key to use one or the other. Commented Aug 25, 2011 at 15:33
  • Essentially a duplicate of apple.stackexchange.com/a/324428/56303. Check the answers there for a solution without using any external program.
    – cprcrack
    Commented May 13, 2022 at 18:38

10 Answers 10

4

In macOS Sierra, you have to Ctrl+Shift+, in numeric pad to obtain a regular dot.

Found this trying to do the same as everyone else and discovered it was different now.

Hope this helps.

UPDATE: in macOS Mojave, you can also use Ctrl+Alt+, in numeric pad to obtain a regular dot. I found some apps (I'm looking at you Slack) don't allow the original answer, but do the update.

3
  • thanks! this is the response I was looking for! Marking it as the accepted answer Commented May 31, 2017 at 8:46
  • Sadly doesn't work on vscode :'(
    – equiman
    Commented May 10, 2018 at 16:36
  • Not the optimal, but it works. Commented Mar 12, 2019 at 14:03
9

You need to change the layout of your keyboard. Not to another one, but to a new one that has been modified by an utility like Ukelele (there might be others).

Download the tool, drag the App to your Application folder. Notice that in the Disk Image, there’s a folder called System Keyboards/Roman/, copy that to you desktop (it’s temporal).

Launch Ukelele and from the File menu select: “New based on…”

Open the file Spanish-ISO.keylayout (found in the Roman folder that you saved to your desktop).

You’ll see a big blue keyboard representing your current Spanish-ISO map (if you brought your computer in Spain, that’s they keyboard you should use).

Double click on the “,” that you want to modify (or any other key) and you’ll see this:

Edit in Ukelele

Replace the “,” with the “.” (dot). And go to Keyboard Menu -> Set Keyboard Name. Rename the Spanish - ISO to something like: Spanish - ISO2.

Now save it, the name will be Untitled, but you should put Spanish - ISO2.

Where do you save it?

According to Ukelele’s User Manual, you have different choices (and I suggest your read section 3.3 of the manual). Short answer is within the Keyboard Layouts sub-folder of the Library folder in your home folder. This can be created if it doesn’t already exist. If you do that, only your user will see (and be able to use) this Layout.

After installing the keyboard layout and logging out and logging in again, open the International pane of System Preferences (Language & Text on Mac OS X 10.6 (Snow Leopard) and later). On the Input Menu (Input Sources in 10.6 or later) tab, your new keyboard layout should be listed there. Enjoy your faster IP Address typing.

4
  • Thanks. In the end, I just used the keyboard layout provided in the disk image and edited it by hand. I wonder why these layouts are not provided with the system (or are they?) Commented Oct 11, 2010 at 8:47
  • Hmm They are, only not in an "easy to use disk image” ;) Commented Oct 11, 2010 at 9:56
  • Yeah I suppose they are somewhere, but not in any Keyboard Layouts directory. Commented Oct 11, 2010 at 13:47
  • 1
    Keyboard layouts saved in ~/Library/ aren't selected by default in password dialogs, but ones saved in /Library/ are. The character picker popovers only work with keyboard layouts saved as bundles.
    – Lri
    Commented Oct 13, 2012 at 3:28
4

KeyRemap4MacBook solves this problem as well, without having to set up a completely different keyboard layout in Ukelele. Simply enable the "Swap Dot and Shift+Dot" option in the "Change Keypad Key" section.

4

There is NO need for an external program.

Create a file named DefaultKeyBinding.Dict under ~/Library/KeyBindings/ (/Users/<username>/Library/KeyBindings/), create the KeyBindings folder if it doesn't exists.

Paste the text below inside the file, save it and restart/logout-login to make it work.

{
  "#," = ("insertText:", ".");
}

Also, here is a gist with more configuration options.

7
  • thanks but this looks overly complicated. Pressing a modifier key is simpler, and from time to time you may still have need of the comma. Commented Sep 20, 2019 at 10:31
  • "but I'll accept any answer that works" was the key Commented Sep 20, 2019 at 15:29
  • 1
    Consider it accepted. Stack Exchange doesn't allow me to accept more than one, though, so I'll keep the accepted on as it's currently the best and which requires less effort Commented Sep 23, 2019 at 15:32
  • :) no biggie! I'm sure it fits most users the accepted answer Commented Sep 23, 2019 at 16:27
  • Wouldn't this also change the default comma to a period? As in what happens when you actually need a comma? Change the period mapping to a comma? This just seems overly weird to me that Apple's OS based on Unix where pretty much every other Linux Distro provides the option to chose between either Belgian Layout with period (default) or Belgian Layout with comma (less used). Commented Aug 26, 2020 at 19:08
3

Just discovered an alternative solution, and at least for me a much better one, which does NOT require keyboard remapping and works on other people's macs too:

press shift when you press the comma on the numeric keypad, it will be entered as a point (at least in snow leopard (osx 10.6))

(As I have a Belgian keyboard layout, I've used the keyboard remapping solution [using Ukulele] for some time, but it didn't play well with all applications, e.g. Eclipse)

2
  • I very much would prefer this solution. But for some reason it doesn't work on the Spanish layouts, but it does on the Belgian. I'll fill a Radar and see what happens. Commented Aug 28, 2012 at 14:11
  • Same here, Belgium keyboard and when I read that you had to use Shift to get a dot instead of the regular method to choice between keyboard layout dot or comma like pretty much any other OS out there has. Just the thought of using an extra key to write a dot disgusts me. Commented Aug 26, 2020 at 19:05
2

David's answer was extremely helpful! Give a try to KeyRemap4MacBook

The app is clumsy & little buggy but does the job.

On my Spanish - ISO keyboard layout had to enable/change:

  • KeyPad-Dot(.) to Command+X (Cut) with Italian (What?)
  • KeyPad Comma(,) to Dot(.) on "Italian Pro Input Source"
1

You can also use a tool like Keyboard Maestro. I’ve set it up like this:

  1. Triggered by: The Hot Key Key Pad . is pressed
  2. Action: Insert Text ‘,’ by Pasting

It works surprisingly fast without having to create a new keyboard layout or remap keys.

1

I use the app Better Touch Tool that allows you to do so all sorts of customizations with gestures and the keyboard. I just added a keyboard assignment that essentially mapped shortcut "pad ," to "." and it works perfectly.

1
  • Welcome to Ask Different! Could you expand on how you used the aforementioned app to achieve this?
    – grg
    Commented Sep 7, 2014 at 15:14
1

The app its now called Karabiner. I figure it out on spanish ISO but I think it can be applied to all layouts.

In the simple modifications tab, after you have set up the app:

  1. Select your target device on the list.
  2. Add item in the bottom left corner
  3. From Key: Keypad_period - To key: Period (.)
0

Ctrl+, (just for the comma in numeric keyboard) yields to a . (dot) when in spanish layout.

Oddly enough this works in terminal and in some text editors (like textwrangler). MacVim, for instance, just renders a . when using , in numeric keyboard. And TextMate just ignores this modifier and prints a ,

... You know, the good thing about apple stuff is that it "just works".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .