September 18, 2021, 06:37:39

Author Topic: Hide keyboard in Android possible?  (Read 920 times)

Offline J7M

  • Jr. Member
  • **
  • Posts: 6
Hide keyboard in Android possible?
« on: August 02, 2021, 20:27:50 »
Hi,

with the commands

w = window()
w.showKeypad()

the keyboard in Android can be shown. Is it somehow possible to hide the keyboard? Reason is, when I'm using the editor in Android with an active keyboard and clicking on run, then the program starts with an open keyboard occupying 1/3 of the screen. My little game is using the full screen for graphics and I have always to hide the keyboard manually.

Best regards, J7M

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Hide keyboard in Android possible?
« Reply #1 on: August 03, 2021, 01:45:53 »
Hi,

with the commands

w = window()
w.showKeypad()

the keyboard in Android can be shown. Is it somehow possible to hide the keyboard? Reason is, when I'm using the editor in Android with an active keyboard and clicking on run, then the program starts with an open keyboard occupying 1/3 of the screen. My little game is using the full screen for graphics and I have always to hide the keyboard manually.

Best regards, J7M

It's not possible in the current version. It can be useful for the keypad to remain open depending on what you are working on. I could make this an option in a future update.

Offline J7M

  • Jr. Member
  • **
  • Posts: 6
Re: Hide keyboard in Android possible?
« Reply #2 on: August 04, 2021, 19:19:08 »
That would be nice. Thank you.

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Hide keyboard in Android possible?
« Reply #3 on: August 13, 2021, 12:48:53 »
The keyboard will hide when you hit run, but automatically re-appear when returning to the editor. If the code executes INPUT the keyboard re-appears. 
Seems like a good change, I don't think this needs to be optional.
« Last Edit: August 13, 2021, 12:51:21 by chrisws »

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Hide keyboard in Android possible?
« Reply #4 on: August 13, 2021, 17:33:52 »
The keyboard will hide when you hit run, but automatically re-appear when returning to the editor. If the code executes INPUT the keyboard re-appears. 
Seems like a good change, I don't think this needs to be optional.

question, does it mean, AFTER entering to INPUT, it will hide again?
Ii would be a nice behavior!!!
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline J7M

  • Jr. Member
  • **
  • Posts: 6
Re: Hide keyboard in Android possible?
« Reply #5 on: August 14, 2021, 14:56:05 »
Yes, that sounds great.

Automatically hiding after input sounds great, too. But then it needs some mechanism to prevent too fast showing and hiding of the keyboard when you have several input commands in a row.

Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Hide keyboard in Android possible?
« Reply #6 on: August 16, 2021, 09:00:35 »
Yes, that sounds great.

Automatically hiding after input sounds great, too. But then it needs some mechanism to prevent too fast showing and hiding of the keyboard when you have several input commands in a row.

I don't think it would be a big problem. As the procedures of saving the screen already exist (eg. img=image(0,0,xmax,ymax)), it would go somehow like this:
- save the screen in memory (I did something like this even in a file, and it was fast enough)
- take the INPUT action (show the keyboard, take the INPUT, hide the keyboard)
- restore the screen
- take the action AFTER ihe INPUT, whatever it may be...
Of course it would take same extra amount of memory, but what the speed concerns it would be no problems. Some flickering between eventual successive inputs is not a problem either.
« Last Edit: August 16, 2021, 09:17:24 by jsalai »
I won't belong to any organization that would have me as a member.
[Groucho Marx]

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Hide keyboard in Android possible?
« Reply #7 on: August 17, 2021, 08:19:10 »
Yes, that sounds great.

Automatically hiding after input sounds great, too. But then it needs some mechanism to prevent too fast showing and hiding of the keyboard when you have several input commands in a row.

I don't think it would be a big problem. As the procedures of saving the screen already exist (eg. img=image(0,0,xmax,ymax)), it would go somehow like this:
- save the screen in memory (I did something like this even in a file, and it was fast enough)
- take the INPUT action (show the keyboard, take the INPUT, hide the keyboard)
- restore the screen
- take the action AFTER ihe INPUT, whatever it may be...
Of course it would take same extra amount of memory, but what the speed concerns it would be no problems. Some flickering between eventual successive inputs is not a problem either.

I tried adding a de-bounce timer and this seems to have solved this issue. So when invoking successive INPUTS, the keypad just stays open and there's no flicker.


Offline jsalai

  • Jr. Member
  • **
  • Posts: 41
Re: Hide keyboard in Android possible?
« Reply #8 on: August 17, 2021, 13:37:58 »
IMHO

NEW, global (not bounded to window) commands:
hide_keyboard
and
show_keyboard

with existing
i=Image(x,y,x1,y1)
i.show(x,y)

at arbitrary (completely free) positions in program would give maximal freedom for any purpose, not only INPUT!

So the programmer (not Chris) take all the responsibility for program flow!

Just an idea...
« Last Edit: August 17, 2021, 13:43:58 by jsalai »
I won't belong to any organization that would have me as a member.
[Groucho Marx]

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal