Author Topic: Sometimes get weird characters when typing in IPTC fields  (Read 6697 times)

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Sometimes get weird characters when typing in IPTC fields
« on: April 29, 2009, 06:15:39 PM »
Frequently, I have the image preview up and then I bring up the IPTC dialog.  If I use Alt and the arrow keys to traverse across three or four images, the first character I try to type after that in one of the fields in the IPTC dialog is usually garbage.  With the way I have my substitution codes set up right now, I am usually typing a number using the numeric keypad, but I can recreate it with the regular letter keys as well.  I think this bug has been around for quite a while, but I've only recently figured out how to recreate it fairly consistently.  In case it matters, I'm on 64-bit Vista Ultimate, but this used to happen on my older XP machine too.

Danny

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24766
    • View Profile
    • Camera Bits, Inc.
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #1 on: April 29, 2009, 07:00:59 PM »
Danny,

Frequently, I have the image preview up and then I bring up the IPTC dialog.  If I use Alt and the arrow keys to traverse across three or four images, the first character I try to type after that in one of the fields in the IPTC dialog is usually garbage.  With the way I have my substitution codes set up right now, I am usually typing a number using the numeric keypad, but I can recreate it with the regular letter keys as well.  I think this bug has been around for quite a while, but I've only recently figured out how to recreate it fairly consistently.  In case it matters, I'm on 64-bit Vista Ultimate, but this used to happen on my older XP machine too.

Do you have Windows set up to use sticky Alt keys?

-Kirk

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #2 on: April 30, 2009, 03:59:44 AM »
No, I do not use sticky Alt keys.  There are two other facts that rule this out.  First, I get the same weird characters even if I type regular letter keys after traversing the images with the Alt arrow keys.  If the Alt key was in sticky mode in this case, PM would be seeing an Alt letter key combination.  Second, I can not duplicate the weird characters by intentionally pressing an Alt plus keys sequence, even if I try Alt plus numeric keypad.

Danny
« Last Edit: April 30, 2009, 12:09:31 PM by TiggerGTO »

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #3 on: May 22, 2009, 05:39:32 AM »
Kirk,
Any other ideas about this one?  Is there some sort of test you would like me to try or debug information you would like me to gather?

Danny

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24766
    • View Profile
    • Camera Bits, Inc.
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #4 on: May 22, 2009, 07:01:08 AM »
Danny,

Any other ideas about this one?  Is there some sort of test you would like me to try or debug information you would like me to gather?

Could you post two screenshots, one before you advance and one after you have advanced and have typed the odd characters?

Thanks,

-Kirk

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #5 on: May 23, 2009, 11:23:48 AM »
Here's a couple screenshots.  The first one shows the IPTC panel on top of the Image Preview.  The second is a close up of the "Object Name" field.  There is nothing to show you in a before advancing because everything looks totally normal.  I recreate this problem by putting the cursor in one of the IPTC fields.  Then I use the alt arrow keys to move around the images in the contact sheet a bit.  It usually only takes traversing over 3 or so images -- sometimes more, sometimes less.

In the first close-up, I typed the letter a in the object name field after doing alt-right arrow 3 times in a row.  The character looks like "ha", but it is actually a single character. The second one, I typed "nic" (abbreviation for player's name for code replacement).  The n typed as some box looking character, the ic typed normally.  I tried to match these characters to ASCII codes, but can't them.  I suspect that the are either Unicode or DBCS characters, but I don't know how to look those up.

[attachment deleted by admin]

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #6 on: May 24, 2009, 05:41:29 AM »
Are you by any chance using the arrow keys of your numeric keypad, this could explain the insertion of the strange "ha" character. What encoding do you use for IPTC, and do you have XMP enabled?

Cheers
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #7 on: May 24, 2009, 11:18:06 AM »
I am using the separate arrow keys on a desktop keyboard, not the ones that are part of the numeric keypad.  For the IPTC encoding, I didn't set anything special, so I am using whatever the default would be for a US English setup/locale.  If you want more specific details, tell me what I need to look at.  I've attached my IPTC/XMP settings below.

I suspect that there may be a latent defect in the keyboard handling -- perhaps the alt keyboard modifier doesn't always get reset when the alt key is released.

[attachment deleted by admin]

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #8 on: May 24, 2009, 11:46:56 AM »
A sticky alt key could be the cause of your problems (I have suffered from sticky keys on Windows machines frequently).

A thing I notice as well on your preference screen grab is that you are using the Mac Roman encoding for your IPTC information. You're on a windows machine though and there you generally use another encoding (e.g., Latin 1). I'm not sure this causes the translation problem (i.e., "ha" turning up as a square) though as you only embed IPTC4XMP info, not the plain IPTC, and IPTC4XMP is unicode (afaik) and should therefore show the special characters just fine.  You may want to experiment with this though (also try enabling "write IPTC as unicode")

Cheers
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24766
    • View Profile
    • Camera Bits, Inc.
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #9 on: May 24, 2009, 06:12:58 PM »
Danny,

Frequently, I have the image preview up and then I bring up the IPTC dialog.  If I use Alt and the arrow keys to traverse across three or four images, the first character I try to type after that in one of the fields in the IPTC dialog is usually garbage.  With the way I have my substitution codes set up right now, I am usually typing a number using the numeric keypad, but I can recreate it with the regular letter keys as well.  I think this bug has been around for quite a while, but I've only recently figured out how to recreate it fairly consistently.  In case it matters, I'm on 64-bit Vista Ultimate, but this used to happen on my older XP machine too.

I'm able to reproduce the problem but I'm not sure what I can do about it.  Let me explain.  I added some debugging code to print out what key input was occurring.  Here is an excerpt with annotations:

c:0 a:1 s:0 msg:260 wParam:39   (Alt-Right arrow down)
c:0 a:1 s:0 msg:261 wParam:39   (Alt-Right arrow up)
c:0 a:1 s:0 msg:260 wParam:39   (Alt-Right arrow down)
c:0 a:1 s:0 msg:261 wParam:39   (Alt-Right arrow up)
c:0 a:1 s:0 msg:260 wParam:39   (Alt-Right arrow down)
c:0 a:1 s:0 msg:261 wParam:39   (Alt-Right arrow up)
c:0 a:0 s:0 msg:256 wParam:65   ('a' key down [produced a box character])
c:0 a:0 s:0 msg:257 wParam:65   ('a' key up)
c:0 a:0 s:0 msg:256 wParam:65   ('a' key down [produced a letter 'a')
c:0 a:0 s:0 msg:257 wParam:65   ('a' key up)

KEY: c=ctrl key down, a=alt key down, s=shift key down, msg:Windows message code, wParam:key code or ascii value

As you can see from above there is no difference in the event that produced the box character and the event that produced the letter 'a'.  The text field (not written by us but by Microsoft) just happens to output an incorrect character when it has had the Alt-Right Arrow key sequence sent to it a few times.  Using the other keyboard shortcut (Alt-]) does not cause this problem to happen.  Why it happens in the first place, I don't know.  Unfortunately I cannot even detect that it is going to happen by checking the key events.

So I'm not sure there is anything I can do to solve this issue.  The workaround is to use the Alt-] and Alt-[ key combos instead.

-Kirk

Offline TiggerGTO

  • Member
  • **
  • Posts: 95
    • View Profile
Re: Sometimes get weird characters when typing in IPTC fields
« Reply #10 on: May 25, 2009, 05:32:19 AM »
I didn't even know about the square bracket key combos.  I'll give them a try.  It's not like this is a huge problem.  It is quite annoying though and because you never know when it will happen, it can slow you down a bit.  Thanks for looking into this though.  Maybe Windows 7 will fix it, but I'm not holding my breath.

Danny