The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Applications (http://hintsforums.macworld.com/forumdisplay.php?f=5)
-   -   Decimal point key (http://hintsforums.macworld.com/showthread.php?t=64684)

allanb 12-12-2006 05:57 AM

Decimal point key
 
Is there a way to make the 'dot' on the numeric keypad function as the decimal separator when entering a number? (I have OS X version 10.4.8.)

I've searched and found a hint on this topic but it only referred to the Calculator. I would like to be able to enter numbers in this way for any application that accepts numeric input (OpenOffice Calc, Mesa, Quicken, Moneydance, etc).

I'm only talking about input, not about the way in which numbers are displayed.

DeltaMac 12-12-2006 08:46 AM

Go to your System Preferences/International/Formats, and change the region to another that supports the decimal point for a separator, such as United Kingdom.

allanb 12-12-2006 03:56 PM

No, sorry, this doesn't work. I think what you're talking about is the way in which numbers are displayed. What I'm talking about is the way in which they are input. In other words, what I want to do is to type (for instance) the characters 1 2 . 5 on the numeric keypad and have that interpreted as the numeric value 12.5 ("twelve point five").

In French that value would be displayed as 12,5. But the display is not my problem; I know how to change that.

fazstp 12-12-2006 05:06 PM

Do you have num lock on?

JDV 12-12-2006 05:23 PM

Not being familiar with differences in keyboard layouts in different countries, I would nonetheless have expected the numeric keypad to work pretty much the same everywhere. On my keyboard, the decimal point on the numeric keypad indeed functions precisely as you want it to, as far as I can tell. What precisely is the result of trying to use the decimal point when you try it on your system?

Joe VanZandt

allanb 12-15-2006 04:50 AM

As suggested by fazstp, I tried to check that the numeric keypad was switched on, only to realize that the little indicator light that normally shows this isn't working. (If I remember correctly, there are 3 of these lights: one for 'NumLock', one for 'insert' and one for the shift lock.) My 'shift lock' indicator is working but the other two are not.

However, the ten number keys are all functioning as numbers, so I assume that NumLock is on, even if there's no light.

In System Preferences the setting is 'UK', which should use the dot as a decimal separator (and this is correctly shown in the System Preferences panel).

What happens when I enter, for example, 1.25 is this:

In any text application (including TextEdit, Stickies, and this forum) the dot is being read as a comma.

In a spreadsheet, either OpenOffice or Mesa, it is also being read as a comma, i.e. it appears as 1,25 in the 'edit' bar. However, OpenOffice interprets it as text: it is left-justified and has the value zero if used in a formula. Mesa also shows it as 1,25 in the 'edit' bar but as 125 in the cell, and interprets it as the numeric value 125, as though the decimal separator didn't exist.

In OpenOffice, the only way I can input the number correctly is to use the 'dot' from the main keyboard. The comma doesn't do it - it is read as text.

The Calculator reads it correctly (but I notice that the Calculator will happily accept any of the three keys as the decimal separator).

I realize that there may be a some kind of bug in Mesa but that wouldn't explain the curious behaviour of OpenOffice.

DeltaMac 12-15-2006 09:17 AM

allanb - if you are still using the PC keyboard, then the little indicator lights mostly do not work on a Mac. All you can do is toggle the numlock on and off, and check if the keypad changes function.
The comma/period problem might be affected by the spanish keyboard that you have now.
The different apps that you mention are a mixture of cocoa and carbon apps. These two different program types respond differently to certain special characters
Have you tried an actual Mac keyboard yet?

biovizier 12-15-2006 10:28 AM

Quote:

"The comma/period problem might be affected by the spanish keyboard that you have now."
It probably isn't the keyboard, rather the keyboard layout ("System Preferences" > "International" > "Input Menu"). The "Spanish" layouts enter a "," when the "." on the numeric keypad is pressed (and a "." in combination with the "shift" key). Others, such as the "US" one, enter a "." for a "." without modifiers. But I suspect Spanish is a requirement for the OP because of the accented chararcters.

Key bindings and keyboard layouts for Cocoa can be edited easily, but the ones that work in Carbon are harder (I only know how using ResEdit in Classic). Fortunately, Tom Gewecke, who seems to be the resident expert at the Apple site on all things "multilanguage" as they pertain to Macs, has posted a bunch of customized layouts on his home page:
http://homepage.mac.com/thgewecke/

I haven't tested them personally, but there is one on there called "SpanISOnumdot.rsrc" - that name seems promising for this situation...

allanb 12-15-2006 10:41 AM

Quote:

Originally Posted by DeltaMac (Post 342192)
allanb - if you are still using the PC keyboard, then the little indicator lights mostly do not work on a Mac. All you can do is toggle the numlock on and off, and check if the keypad changes function.
The comma/period problem might be affected by the spanish keyboard that you have now.
The different apps that you mention are a mixture of cocoa and carbon apps. These two different program types respond differently to certain special characters
Have you tried an actual Mac keyboard yet?

No, I haven't. Thanks for the suggestion.

Would any Mac keyboard work? I need the Spanish layout for various reasons, and I wouldn't mind investing in a new keyboard, but so far my googling hasn't found a supplier offering one specifically for the Mini.

allanb 12-16-2006 07:53 AM

Quote:

Originally Posted by biovizier (Post 342201)
Tom Gewecke, who seems to be the resident expert at the Apple site on all things "multilanguage" as they pertain to Macs, has posted a bunch of customized layouts on his home page:
http://homepage.mac.com/thgewecke/

I haven't tested them personally, but there is one on there called "SpanISOnumdot.rsrc" - that name seems promising for this situation...

Thank you. I followed your link and downloaded the file. The "dot" problem is fixed. Unfortunately, almost all of the accents and punctuation marks are now in the "wrong" place on the keyboard and I can only find them by trial and error.

I'm sorry but I don't know how to undo what I did, i.e. uninstall the new file. Can you help? (it took me a long time to find that question mark)

allanb 12-16-2006 09:58 AM

To all those who are kindly taking an interest in this: please ignore my last cry for help. I now see that opening the downloaded layout file caused the system to switch the keyboard choice to "British". Switching it back to "Spanish" solves problem nº 2.

Problem nº 1 (the "dot" problem) remains, and I will follow up the suggestion about the Mac keyboard.

biovizier 12-16-2006 11:43 AM

Hold on a second - I just re-read this thread... Are you using "French", or "Spanish"? I see you are located in "France" and you mentioned "French" in post 3, but I may have been thrown off by the reference to "Spanish" in post 7. But all subsequent references are to "Spanish".

If you are using "Spanish", then the "Spanish - ISO" layout on which "SpanISOnumdot.rsrc" is based is slightly different so that might be why it seems unfamiliar.

If you are actually using "French", it would make sense why the "Spanish" key layout would confuse you. But Tom Gewecke does seem to have "Frenchnumdot.rsrc" and "Frenchdot.rsrc" layouts on his site as well...

allanb 12-16-2006 04:05 PM

I'm using Spanish. Maybe I should explain, in case anyone thinks I'm crazy: I'm British but I work in several languages, and the advantage of the Spanish keyboard layout is that it offers all the accented characters needed for Spanish, French, Italian and a few others but the alphabetic characters are in the English layout (QWERTY, etc). I'm too old to learn a new alphabet layout.

Of course, all the special characters are available in character tables or by using numeric codes, but it's a lot easier to have them on the keyboard.

biovizier 12-16-2006 04:22 PM

Ahh, that does help to establish some context. So the current "Spanish" layout that is satisfactory except for the fact that a "," is entered when the "." is pressed on the numeric keypad - is it either of the standard "Spanish", or "Spanish - ISO" layouts included with OS X, or is it something different? I.e. if the "Show input menu in menu bar" box is checked in "System Preferences" > "International" > "Input Menu", what layout does the menu show as being active while typing normally with your preferred layout?

allanb 12-17-2006 03:19 AM

Quote:

Originally Posted by biovizier (Post 342474)
If the "Show input menu in menu bar" box is checked in "System Preferences" > "International" > "Input Menu", what layout does the menu show as being active while typing normally with your preferred layout?

In the list that starts with Afghan and ends with Welsh, the only one with a check mark is "Spanish ISO". Did I understand your question correctly? I notice, by the way, that the check mark is "greyed" and can't be toggled.

Since my adventure with the downloaded layout file, although I'm essentially now back to where I was before, a trivial but curious detail is that two keys have switched functions: the one which gives me the superscript 'a', the superscript 'o', and the backslash; and the other which gives me the 'less than' and 'greater than' symbols. A non-technical solution for this is to switch the buttons, which I have done.

DeltaMac 12-17-2006 08:32 AM

You can't change the selected layout if you only have one selected (or present in the 'Flag' icon on your menubar.
You can also select the 'keyboard viewer' from that list of keyboard layouts, which will show you a representation of your keyboard on your screen. Pressing the keys will show you which special characters are controlled by which keys.
Seems like you still have an incorrect layout selected, so add one more to the menu, and that will allow you to re-choose another.

gupdanazilda 12-17-2006 08:50 AM

I use a software called hotkeyboard and whenever i press that key in specific it automatically parses the text i need there

biovizier 12-17-2006 12:41 PM

Hmm, I guess DeltaMac was on the right track all along - it's starting to look like an issue of keyboard hardware differences. When I look at the Spanish - ISO keyboard layout using my Apple extended whatever (standard shipping with Macs in Canada), I don't see any superscript "a" or "o" at all (I do see them in the plain "Spanish" layout, with the "option" or "shift" modifiers on the '[ / {' key to the right of the "P" key).

Still, if you are using the "Spanish - ISO" layout, I'm surprised the "SpanISOnumdot.rsrc" layout didn't work since as far as I can tell, the only difference between it and the standard Apple "Spanish - ISO" is the "." on the numeric keypad.

allanb 12-18-2006 04:21 AM

Quote:

Originally Posted by DeltaMac (Post 342594)
You can't change the selected layout if you only have one selected (or present in the 'Flag' icon on your menubar.
You can also select the 'keyboard viewer' from that list of keyboard layouts, which will show you a representation of your keyboard on your screen. Pressing the keys will show you which special characters are controlled by which keys.
Seems like you still have an incorrect layout selected, so add one more to the menu, and that will allow you to re-choose another.

This looks like a promising approach - but I've checked the option "Keyboard Viewer" and nothing happens. Can you tell me exactly what I have to do to see the representation of the keyboard on the screen?

DeltaMac 12-18-2006 08:17 AM

Selecting the Keyboard Viewer adds that to the 'flag' menu. Simply select from the 'flag' menu in your menu bar.

NovaScotian 12-18-2006 10:57 AM

If you have several languages in your Keyboard layout menu (the little flag next to Spotlight in the menu bar) then this AppleScript will toggle through each one every time it is run. If you give it a hot key using any of the available tools (I use FastScripts), a key combo will switch for you.

Code:

tell application "System Events" to tell process "SystemUIServer"
        set _ to get value of attribute "AXDescription" of every menu bar item of menu bar 1
        set {k, j} to {count of _, 0}
        repeat with i from 1 to k
                if _'s item i is "text input menu extra" then
                        set j to i
                        exit repeat
                end if
        end repeat
       
        if j > 0 then
                tell menu bar item j of menu bar 1
                        click
                        tell menu 1
                                set {lk, kl, i} to {get name of every menu item, {}, 0}
                                repeat
                                        set i to i + 1
                                        if lk's item i is missing value then exit repeat
                                        set end of kl to lk's item i
                                end repeat
                                (* now we have a list of installed layouts *)
                               
                                set knt to count of kl
                                if knt > 1 then
                                        repeat with i from 1 to knt
                                                if (value of attribute "AXMenuItemMarkChar" of menu item (kl's item i) is not "") then
                                                        if i = knt then
                                                                set i to 1 (* back to top of list *)
                                                        else
                                                                set i to i + 1 (* switch to next layout *)
                                                        end if
                                                        exit repeat
                                                end if
                                        end repeat
                                        click menu item (kl's item i)
                                end if --  knt > 1
                        end tell -- to menu 1
                end tell -- to menu bar item…
        end if --  j > 0
end tell -- to process and System Events


allanb 01-18-2007 01:46 PM

Thanks, but it's beyond my technical ability to follow this instruction.

NovaScotian 01-18-2007 02:04 PM

It need not be. If you copy the script in the code box and paste it into a fresh page in your Script Editor (Spotlight for it), and then click the run button, it will change your language setting to the next item on the list under the languages flag on your menu bar each time you run it.

To get a script menu in your menu bar, you'll have to find the applescript provided to enable it (I can't find mine). If you then save my script as you have it in the Script Editor in the Scripts folder found in your user Library/Scripts folder, it will show up in that menu and by selecting it, you run the script.

vike 06-24-2009 06:08 PM

input menu shortcuts - system
 
os-x has since some time had the ability to set chortcuts to toggle/cycle input "source" (layout)

in os 10.5 (leopard) this is accessed in "system preferences"'s
either ("keyboard&mouse"):{keyboard shortcuts}:[outline]:|>="input menu"=" (".. previous .." toggles last/2nd last)
or ("international")->["input menu shortcuts"] with takes you to ["keyboard&mouse"]


i got here from g**gle in a different matter, namely to have applescript parse a real/float out of a numeric string with the decimal dot (eg "1.2") when the sys's international/locale's decimal point is the comma (",")
you know how?


All times are GMT -5. The time now is 01:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.