(Hidden) Password XBMC keyboard dialog???

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Post: #11
Big Grin
kraqh3d Wrote:you'll have to wait for the next t3ch release then.
Hi, I have grabbed the SVN. Just obtaining the apropriate programs needed to compile at the moment.

Cheers for the help.
find quote
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Post: #12
Hi,

Can't get the hiddeninput function in my script going, i used the following code:

def getpassinput(self):
mastpassw = ""
keyboard = xbmc.Keyboard(mastpassw, "Please Enter Password")
keyboard.setHiddenInput(True)
keyboard.doModal()
mastpassw = keyboard.getText()

I also tried the "setHiddenInput" with "()" instead of true and no go, also tried moving the line above and below the do.Modal and still no luck.
Is this the right way of doing it?

Cheers
find quote
kraqh3d Offline
Retired Developer
Posts: 7,183
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #13
try using "1"... there isnt really a bool datatype... its faked with an unsigned char... but False should be interprettted as zero, and True as one so I dont think thats the problem.

** edit **
also, the way its coded, if you just do "kb.setHiddenInput()" with no argument in the parens, it should default to hidden.

let me know, if its still not working. and please email me a short test script.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2007-01-13 16:18 by kraqh3d.)
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,914
Joined: Dec 2004
Reputation: 17
Post: #14
Code:
import xbmc
def getKeyboard( default = "", heading = "" ):
  keyboard = xbmc.Keyboard( default, heading )
  try:
    keyboard.setHiddenInput( True )
    keyboard.doModal()
    if ( keyboard.isConfirmed() ):
      return keyboard.getText(), True
  except:
    pass
  return default, False

mastpassw, succeeded = getKeyboard( "", "Please Enter Password" )
print mastpassw, succeeded

That works on the xbox, for some reason it errors on the PC after you cancel or accept the keyboard.

Edit: It actually works and prints the result, but XBMC_PC.exe errors with the following. Also it doesn't matter if the setHiddenInput() is used. Must be something with this specific code, because other scripts work fine with the keyboard.

Quote:
09:52:53 M:126373888 INFO: test
09:52:53 M:126373888 INFO:
09:52:53 M:126373888 INFO: True
09:52:53 M:126373888 INFO:
09:52:53 M:126373888 INFO: Scriptresult: Succes
09:52:53 M:126373888 INFO: Python script stopped
09:52:53 M:126382080 FATAL: EXCEPTION_ACCESS_VIOLATION (0xc0000005)
at 0x006af0e3
(This post was last modified: 2007-01-13 16:57 by Nuka1195.)
find quote
kraqh3d Offline
Retired Developer
Posts: 7,183
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #15
So to confirm, it works on the Xbox, but not on the PC?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,914
Joined: Dec 2004
Reputation: 17
Post: #16
it actually works on both, but xbmc_pc.exe crashes after it prints the results with the above code.

Another script I use with the same code, except it uses the keyboard inside a window class does not crash xbmc_pc.exe.

This code inside a window class does NOT crash xbmc_pc.exe.

Code:
def getKeyboard(self, default = "", heading = ""):
        keyboard = xbmc.Keyboard(default, heading)
        try:
            keyboard.setHiddenInput( True )
            keyboard.doModal()
            if (keyboard.isConfirmed()):
                return keyboard.getText(), True
        except:
            pass
        return default, False
find quote
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Lightbulb    Post: #17
I could only get it working on the xbox, no problem tho, i just added a try eg:

try:
keyboard.setHiddenInput(True)
except:pass

This way, if im using pc, it will skip it, and also for people with an older XBMC build, it won't freeze their xbox's.

Also, wondering if there is a way to do this same thought of thing (replace the input with *'s) but with labels.

So once, the password is set, the label for it can also contain the *'s.
At the moment i just set the label to "*******" but then it is always the same and not the correct amount of *'s for the password length. This is no big deal, but just wondering.

Oh, and big up's for implementing this so quick!!! :-D

Cheers
Stanley87
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,914
Joined: Dec 2004
Reputation: 17
Post: #18
@stanley87, it sounds like you don't have an updated xbmc_pc.exe.

edit: the label thing should be done with code, just:

Code:
self.passwdLabel.setLabel('*' * len(mastpassw))

edit2: @kraqh3d, xbmc_pc.exe does NOT crash using the skin clearity with the code outside of a class, odd. Might be something on my end. So I'm saying the keyboard code works fine.
(This post was last modified: 2007-01-14 05:38 by Nuka1195.)
find quote
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Post: #19
Nuka1195 Wrote:@stanley87, it sounds like you don't have an updated xbmc_pc.exe.

edit: the label thing should be done with code, just:

Code:
self.passwdLabel.setLabel('*' * len(mastpassw))

edit2: @kraqh3d, xbmc_pc.exe does NOT crash using the skin clearity with the code outside of a class, odd. Might be something on my end. So I'm saying the keyboard code works fine.


Hi thanks, that worked a treat.

You are correct, i'm using the latest compile of XBMC but using an old XBMC_PC.exe. Is there a .bat to compile this or just BUILD through VS NET 2003?
find quote
Post Reply