Ignore Show/hidekeyboard() on non mobile versions

Feature requests for future versions of Hollywood can be voiced here
Post Reply
zylesea
Posts: 227
Joined: Tue Feb 16, 2010 12:50 am
Location: Westfalen/Germany
Contact:

Ignore Show/hidekeyboard() on non mobile versions

Post by zylesea »

ShowKeyboard() and HideKeyboard() are useful for Android only (well, maybe on Windows, too - dunno). I would suggest that this command just gets ignored at least on all Amiga flavours (there's no mobile keyboard for these), as it is a bit annoying to remove the command for testing on the dev systems all the time and activate it again for the android version (dunno how often I did it wrong in one of the both ways: either leave it it in on my MorphOS test builds or leaving it out on the Android test applet.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Ignore Show/hidekeyboard() on non mobile versions

Post by airsoftsoftwair »

I'm pretty undecided on what would be the best way to deal with this problem. There are many platform-dependent functions so just making ShowKeyboard() and HideKeyboard() available everywhere would be somewhat inconsistent because then one would also have to think about what to do with all the other platform-dependent functions like ReadRegistryKey(), ShowRinghioMessage(), SetWBIcon().... but making all those available on all platforms probably isn't the best idea. So why not just use a simple wrapper function which uses GetVersion() to find out if the platform is Android and then call the functions and otherwise do nothing?
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: Ignore Show/hidekeyboard() on non mobile versions

Post by Allanon »

Hi,
a simple solution could be to overwrite native commands with dummy functions, for example:

Pseudo-code at the beggining of the script:

Code: Select all

If Platform <> "Android"
   ShowKeyboard = Function() EndFunction
   HideKeyboard = Function() EndFunction
EndIf
This way when the script executes the commands for a platform that is not Android it will execute the dummy functions doing nothing.
It should work :)
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: Ignore Show/hidekeyboard() on non mobile versions

Post by Bugala »

Otherwise aagree on Allanons approach, but when it comes to this specific command, I could also see zyleseas approach being wise approach, mainly because we dont really know what future holds. Maybe there is one day Amiga Tablet available to us, and then we might actualyl have use for that show/hide keyboard command, and if having Allanons approach, then would need to edit the code, compared to Zyleseas approach that all you woudl need to do is compile it with new Hollywood version and voila, it works on new Amiga tablets as it is.

Maybe one approach could be a new command which would give you possiblity to control which platforms would ignore or only drive some commands:

Code: Select all

ONLYRUNCOMMANDONPLATFORM(command, {platform1, platform2, ...})
IGNORECOMMANDONPLATFORM(command, {platform1, platform2, ...})
This way you could put your programs first lines as setting which commands are ran on which platforms, with idea that for example hide/show keyboard you could specifically choose to be only executed on Android, and nowhere else, and then if there comes more, add more platforms to the list, while if there is something that tablets dont have, you could tell it to be Ignored in those platforms and yet if Hollywood starts to support for example Commodore 64 suddenly, then it would still work on Commodore 64 as it wouldnt be having that limitation.

IN case you would then need to modify command to run or ignore more platforms, then it would be simply a matter of checking first few lines of your program and setting or removing some platforms from the list, instead of going through every place in your code and looking for those Allanons suggested lines and adding platforms to there.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Ignore Show/hidekeyboard() on non mobile versions

Post by airsoftsoftwair »

I still have preprocessor conditional commands on my to do list. Something like @IF, @ELSEIF, @ELSE, @ENDIF. In contrast to the normal if statements they're evaluated at compile time so they allow for conditional compiling which would be nice to have in certain situations. Although this has been on my agenda for about 10 years now, I'm still hoping to come up with it one day :)
Post Reply