blackberry / DosBox

DosBox is a MS-DOS emulator used to play older games and applications meant to run on DOS.
GNU General Public License v2.0
58 stars 18 forks source link

Failed to Load sdl-controls.xml and mouse No Touch Input #1

Closed a7omic closed 12 years ago

a7omic commented 12 years ago

Hi,

I was able to build dosbox without error but when I package, load and run on the playbook the IDE gives the following output when it is starting up:

I/O warning : failed to load external entity "sdl-controls.xml" Unable to parse control file sdl-controls.xml

Dosbox runs and I have been successfully running some applications but I have not been able to figure out what this error means or what it is impacting.

The touch interface does not seem to be working. The virtual keyboard works at the command line and in applications but I do not have any mouse control using the touch screen. Only one gesture seems to be registering with the IDE and thats swipe down from the top bezel but it doesn't do anything it just states unknown gesture or something like that(sorry I'm not on that PC right now)

Could these 2 issues be related?

Thoughts?

Thank you.

jnicholl commented 12 years ago

You're correct, these two issues are definitely related. Converting from a touchscreen into mouse input is not necessarily a trivial process, so I had designed a little library (TouchControlOverlay) to convert touch screen input into mouse input in a well-defined way. Basically, you create a sdl-controls.xml file and upload it as part of your application, and this specifies regions on the screen that will be converted into various types of mouse input. The swipe-down gesture is meant to show a more helpful overlay of the various areas on the window, so that you can make the interface fairly minimal when the game is running, and show more when the swipe down event occurs.

I really need to write up a tutorial on how to properly write a sdl-controls.xml file, but here's a quick sample, taken from Battle for Wesnoth. Basically, it shows exactly one full-screen control, with no label or image, that will convert 'taps' into clicks, 'holds' into right-clicks, and moves into mouse move. There is no way to drag the mouse with a button pressed in this form, nor any way to press any keyboard keys while handling mouse events.

<?xml version="1.0" encoding="ISO-8859-1"?>

This next one is the sdl-controls.xml used in OpenTTD.

<?xml version="1.0" encoding="ISO-8859-1"?>

This creates a touch area which generates relative mouse motion (not absolute mouse motion like the touchscreen control), with four mouse buttons on the left, each with labels. The toucharea is tap sensitive but does not handle hold actions. The mouse buttons will generate, respectively, shift left-click, right-click, left-click and control left-click. Hopefully this helps, Jeremy

-----Original Message----- From: a7omic [mailto:reply@reply.github.com] Sent: Friday, November 04, 2011 3:31 PM To: Jeremy Nicholl Subject: [DosBox] Failed to Load sdl-controls.xml and mouse No Touch Input (#1)

Hi,

I was able to build dosbox without error but when I package, load and run on the playbook the IDE gives the following output when it is starting up:

I/O warning : failed to load external entity "sdl-controls.xml" Unable to parse control file sdl-controls.xml

Dosbox runs and I have been successfully running some applications but I have not been able to figure out what this error means or what it is impacting.

The touch interface does not seem to be working. The virtual keyboard works at the command line and in applications but I do not have any mouse control using the touch screen. Only one gesture seems to be registering with the IDE and thats swipe down from the top bezel but it doesn't do anything it just states unknown gesture or something like that(sorry I'm not on that PC right now)

Could these 2 issues be related?

Thoughts?

Thank you.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/DosBox/issues/1


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

a7omic commented 12 years ago

Fantastic. I grabbed the the openTTL files and added them to the dosbox project, updated the dosbox blackberry-tablet.xml assets and repackaged and the overlay is now working.

What is strange is that I still received the same error even though it is working.

That tutorial would be very helpful indeed. Is there any kind of documentationat all? Or do you have any examples of mapping areas of the screen to specific keys such as escape or the arrow keys?

Thank you very much, I really appreciate it.

jnicholl commented 12 years ago

That's strange that the error is still reported. That's presumably a bug in my code. Sorry about the lack of documentation, I don't have anything ready to publish yet. Try creating a key control and setting sym, mod, scancode and unicode properties for it in the xml. They should all correspond to the fields in the SDL_keysym structure. For example, I think dosbox expects up,down,right, and left arrow keys to have scancodes of 72,75,77 and 80. Mods are for ctrl/shift/alt. Unicode is awkward. For now, just ignore it, dosbox doesn't care, you can put anything. Syms are found in the sdl keysym header file, looks like you want 273,274,275 and 276. You shouldn't need to create a label for it, just position it (x,y,width,height). I'll try to have something up by next week with more details.

----- Original Message ----- From: a7omic [mailto:reply@reply.github.com] Sent: Friday, November 04, 2011 09:39 PM To: Jeremy Nicholl Subject: Re: [DosBox] Failed to Load sdl-controls.xml and mouse No Touch Input (#1)

Fantastic. I grabbed the the openTTL files and added them to the dosbox project, updated the dosbox blackberry-tablet.xml assets and repackaged and the overlay is now working.

What is strange is that I still received the same error even though it is working.

That tutorial would be very helpful indeed. Is there any kind of documentationat all? Or do you have any examples of mapping areas of the screen to specific keys such as escape or the arrow keys?

Thank you very much, I really appreciate it.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/DosBox/issues/1#issuecomment-2638405


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

jnicholl commented 12 years ago

I wrote some documentation for TouchControlOverlay at https://github.com/blackberry/TouchControlOverlay/wiki. Hopefully that helps a bit. Did you figure out the keyboard events, or anything I can do to help?

I also figured out why the error messages are appearing. My current work with SDL checks for sdl-controls.xml in the current directory first, and then checks in app/native. If the file doesn't exist in the current directory, it'll print that message, then check in app/native, find it, and continue without problems. I've opened an issue in SDL (https://github.com/blackberry/SDL/issues/1) to track this.

a7omic commented 12 years ago

I was able to get key inputs working but I was seeing some very strange behavior. My first one works perfectly, all the rest not so much.

The new keys I place are at the bottom of the screen but I could not see them. I would see it with the swipe down though. When in the swipedown I moved the key to the top of the page and then a second image of my key appeared below the first.

This one can be seen normally but the touch corresponds to the first.

I have run into some IDE issues so I am reinstalling and will then rebuild the project. Once everything is back up I will try a couple things and report my findings.

jnicholl commented 12 years ago

In order to see them without the swipe down, you'll need to add labels for them. Only the labels are shown outside of the swipedown screen. In terms of moving them, it sounds like there are a number of keys on top of each other? If you send me your xml file, I'll try it out.

----- Original Message ----- From: a7omic [mailto:reply@reply.github.com] Sent: Tuesday, November 08, 2011 08:28 AM To: Jeremy Nicholl Subject: Re: [DosBox] Failed to Load sdl-controls.xml and mouse No Touch Input (#1)

I was able to get key inputs working but I was seeing some very strange behavior. My first one works perfectly, all the rest not so much.

The new keys I place are at the bottom of the screen but I could not see them. I would see it with the swipe down though. When in the swipedown I moved the key to the top of the page and then a second image of my key appeared below the first.

This one can be seen normally but the touch corresponds to the first.

I have run into some IDE issues so I am reinstalling and will then rebuild the project. Once everything is back up I will try a couple things and report my findings.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/DosBox/issues/1#issuecomment-2667360


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

a7omic commented 12 years ago

Here is the xml, the escape key at 0,0 is fine. I moved the Up key to the top beside the escape and it stays visible but you can see the ghosting. The other three keys do not stay visible. If you swipe down and then drag one all the way up you will see the ghosting for those as well. All keys are 40x40 at 72 pixels/inch.

<?xml version="1.0" encoding="ISO-8859-1"?>

jnicholl commented 12 years ago

I think I figured out at least part of the problem. Label coordinates are relative to their controls, not absolute. So only the escape key works because its label is at 0,0. The intention was that labels could be more customized to perhaps take up less screen space than the touch area.

-----Original Message----- From: a7omic [mailto:reply@reply.github.com] Sent: Tuesday, November 08, 2011 1:24 PM To: Jeremy Nicholl Subject: Re: [DosBox] Failed to Load sdl-controls.xml and mouse No Touch Input (#1)

Here is the xml, the escape key at 0,0 is fine. I moved the Up key to the top beside the escape and it stays visible but you can see the ghosting. The other three keys do not stay visible. If you swipe down and then drag one all the way up you will see the ghosting for those as well. All keys are 40x40 at 72 pixels/inch.

<?xml version="1.0" encoding="ISO-8859-1"?>


Reply to this email directly or view it on GitHub: https://github.com/blackberry/DosBox/issues/1#issuecomment-2671313


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

a7omic commented 12 years ago

Ahh this makes sense now, I set all the labels for 0,0 and it works as I wanted.

jnicholl commented 12 years ago

Let me know if you have any more issues with it. I'll close this issue for now. Thanks!