Elvas Tower: Oh PAUSE key where art thou in v0.6.2 - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Oh PAUSE key where art thou in v0.6.2 F1 help screen still says "None"! Rate Topic: -----

#1 User is online   Eldorado.Railroad 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 984
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 06 August 2011 - 10:21 AM

?

#2 User is offline   longiron 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 3,179
  • Joined: 25-July 08
  • Gender:Male
  • Location:Manasquan, NJ
  • Simulator:Open Rails, MSTS editors
  • Country:

Posted 06 August 2011 - 10:40 AM

View PostEldorado.Railroad, on 06 August 2011 - 10:21 AM, said:

I mentioned the lack of a "Pause" key definition for v677.pauseless,

Eldorado


Don't you have a pause key on your keyboard? Are you on a laptop? Please check the F1 HUD for PAUSE key mapping for your specific system. It works on a normal full keyboard.

#3 User is offline   JSchultz 

  • Hostler
  • Group: Status: Active Member
  • Posts: 76
  • Joined: 17-March 09
  • Gender:Male
  • Location:The Windy City
  • Country:

Posted 06 August 2011 - 02:11 PM

The pause key works for me with v0.6.2. I also have Windows 7 64bit.

#4 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 07 August 2011 - 01:31 AM

View PostEldorado.Railroad, on 06 August 2011 - 08:55 PM, said:

The documentation that I have read for keyboard scancodes suggests that the scancode for the "Pause" key is "never as simple" as defined in UserInputs.cs. If anything it is an elaborate multi-byte scancode returned from the keyboard. Some documentation I have read for XNA suggests that the "Pause" key is not directly supported at all!

Commands[(int)UserCommands.GamePause] = new UserCommandKeyInput(0x11D);


The 0x11D is in fact a multi-byte scancode representation within OR (for "E1 1D"). Values over 0x80 represent "E0 hh" extended codes and values over 0x100 represent "E1 hh" extended codes.

View PostEldorado.Railroad, on 06 August 2011 - 08:55 PM, said:

I would suggest that something is going on that could kill the 0x11D scancode use altogether, which is what I am troubled with here. This was NOT a problem in v645 and I would love to compare code sources with what is currently released, because the "Pause" key is gone as of v677.


The code was rewritten between v645 and v677 to use scancodes so that we didn't have problems with keyboard layouts.

View PostEldorado.Railroad, on 06 August 2011 - 08:55 PM, said:

I have written a couple sample programs to insure that windows does see the "Pause" key correctly when it is pressed and it does. So the problem does not appear to be hardware related on this (and another) machine.


You're almost certainly using virtual keys instead of scancodes, though, and I would be shocked if virtual keys didn't get Pause correctly. ;)

There are two possible problems here; either MapVirtualKey() on Windows XP does not support the multi-byte scancodes as well as Vista+, or the keyboard driver is simply producing a completely different scancode for Pause.

Do you have the .NET 4 Framework Client Profile installed? I have a small test app that could potentially shed light on what's different about your system vs those that are working.

#5 User is offline   spud 

  • Conductor
  • Group: Status: Inactive
  • Posts: 365
  • Joined: 05-May 10
  • Gender:Male
  • Location:Pensacola
  • Country:

Posted 07 August 2011 - 05:55 AM

Actually I do not understand a word of what is being discussed but for what it is worth I have installed the last three versions of OR and NONE of them has allowed me to use the PAUSE key. I run XP SP3 with NET 4 Framwork installed. System is DELL XPS600 3.4 MHz CPU

#6 User is offline   BillC 

  • Conductor
  • Group: Private - Open Rails Developer
  • Posts: 322
  • Joined: 31-May 11
  • Gender:Male
  • Country:

Posted 07 August 2011 - 12:56 PM

James,
I also have the same problem. Using XP with SP 3, running on a Dell 530. Using an Logitech USA 101 keyboard.

Did a google search for scan codes, came across the following web page:
http://www.dragonblo...ause-break-key/

There is a quote; "The Pause/Break Key can sometimes be Special: NUM_LOCK (00_45) or Unknown:"
When using the shareware they reference SharpKeys, pressing the Pause/Break key see the NUM_LOCK (00_45)

As there are other ways to achieve the same results, via save/resume it's not worth it to me to start hacking
the registry. Also appears to be a XP or Dell specific problem.

Bill

#7 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 09 August 2011 - 12:33 AM

View PostEldorado.Railroad, on 07 August 2011 - 03:40 PM, said:

At this point, and certainly on paper this seems correct. The "E1 1D" value is a "place holder" for a much longer string, unlike most of the other keys. Can I assume that the code is not checking the whole string that is returned as the scancode? Could this not be a source of trouble if the calling function is only expecting a 2 byte string instead of something that is much longer than that?


The "E0 hh" and "E1 hh" extended scancodes are the documented way Windows's API expose all the fun parts of keyboard input (i.e. beyond the basic range); anything outside the base scancodes is a tricky area though and certainly the keyboards themselves return some horrible stuff to Windows.

View PostEldorado.Railroad, on 07 August 2011 - 03:40 PM, said:

...and thus you would most certainly be absolutely...correct! Which leads me to perhaps stand up and ask (cap in hand!), why not avoid the whole mess and just use virtual keys instead? Is that not possible in XNA?


We were using virtual keys, but the main area (letters and numbers) move around depending on keyboard layout, which is problematic. I have been thinking about using a mixture, of virtual keys for the 'fixed' ones and scancodes for the others, but it's more complicated than doing one thing for every key.

View PostEldorado.Railroad, on 07 August 2011 - 03:40 PM, said:

Mr. Ross it certainly is installed now! So if you have that small app ready for testing in a WinXP environment please send it my way and I will return the results to you in the manner you wish.


Attached is the small program; if you run it, it will dump the scancode -> virtual key, and virtual key -> scancode mappings provided by the Windows APIs and then open a window to let you try pressing keys (which will report the virtual key and scancodes it found). The most useful thing would be attaching a copy of the first two tables (you can do this by running the program from the command-line as "KeyboardDump.exe > keyboard.txt" and closing the popup window when it appears).

Attached File(s)



#8 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 10 August 2011 - 01:08 PM

View PostEldorado.Railroad, on 09 August 2011 - 01:33 PM, said:

I ran this program and if I am correctly reading its output, Scancode->VK works, but the reverse does not! I also tried pressing the Pause and Numlock keys and left that in the at the end of the redirected output text file. If this program works back and forth in Win7 (32 or 64?) I would like to know.


It certainly does go both ways here (Windows 7 64bit), but it might just be that Windows XP doesn't support MapVirtualKeyEx with MAPVK_VK_TO_VSC_EX. OR doesn't use this conversion, it only uses scancode->VK, but it is interesting that it gets nothing out of it.

Looking at the docs for the scancode->VK conversion again, it appears that extended (both "E0" and "E1") scancodes are only supported in the conversion API in Vista and later. Damn. So even if Windows XP knows it is "E1 1D" --> "13", it won't tell us that, which is why OR can't find your Pause key.

I think we can just hard-code that conversion; the input is fixed in OR as "11D" so if a keyboard uses another scancode it'll break everyone anyway and the output is fixed in Windows as "13".

View PostEldorado.Railroad, on 09 August 2011 - 01:33 PM, said:

In my research into scancodes the "ambiguous" definition for the "x11D" keeps on coming up. In this case it is "Right Ctrl" as I have seen elsewhere (other documentation). It may be that because the Pause key is a special case for multibyte responses, the inability to use it should allow for other keys in its place with the same function in mind (maybe Scroll Lock?)


In the scancode table, both "9D" and "11D" show up as "Right Ctrl" - this is the same as for me and actually a bit of a bug in the KeyboardDump program [1]. The difference is that they map to VKs "A3" (Right Control) and "13" (Pause) here, but for you just "00" (None/undefined) for both.

[1] The function that gets the key names only supports basic and "E0" extended scancodes and it appears my code is passing the "E1" extended ones in the same as "E0", so the matching "9D" and "11D" names are expected but in reality only "9D" is called "Right Ctrl".

#9 User is offline   Noli 

  • Apprentice
  • Group: Status: Switchman
  • Posts: 8
  • Joined: 06-February 11
  • Gender:Male
  • Country:

Posted 12 August 2011 - 01:19 PM

Hi, I am also experiencing some problems with the OR key mapping.

OR version 0.6.2
Windows XP SP2
Keyboard layout: Belgian Azerty

Attached is the text file generated by the keyboardDump program, and from the detected keyboard layout it is clear a couple of keys are not correctly detected. You can find the reference layout here: http://en.wikipedia....pc_keyboard.svg I also attached the OR keyboard dump: all keys that include "Ã" do not function in the game.

Anyway, I assume this problem will resolve itself once you include a custom key mapper, since I can imagine it's not trivial to support every possible keyboard layout. :sweatingbullets:

Attached File(s)



#10 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,492
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 12 August 2011 - 02:41 PM

View PostNoli, on 12 August 2011 - 01:19 PM, said:

Hi, I am also experiencing some problems with the OR key mapping.


...but not related to the pause key not working, so please don't pollute threads. Start a new one for a different issue.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users