Home AMX User Forum NetLinx Studio

DATA_EVENT from Keypad on Port 2?

I want to capture a DATA_EVENT from the onboard keypad on a different port...

At this time I only get the "KEYP-" return from the keypad on port 1 (10001:1:1), but a module I'm writing uses port 2 (10001:2:1).
Has anyone ever dealt with this before?

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    yuri wrote: »
    I want to capture a DATA_EVENT from the onboard keypad on a different port...
    No can do, it will only report back on port 1.

    Try reading through this thread. Your problem is addressed near the middle of the first page.

    http://amxforums.com/showthread.php?t=426

    HTH
  • ericmedleyericmedley Posts: 4,177
    yuri wrote: »
    I want to capture a DATA_EVENT from the onboard keypad on a different port...

    At this time I only get the "KEYP-" return from the keypad on port 1 (10001:1:1), but a module I'm writing uses port 2 (10001:2:1).
    Has anyone ever dealt with this before?

    You could setup the buttons on the keypad to 'string output' on whatever port you wish and then look for the text there.

    In TPD4 it's in the Button_Properties- Programming - string Output Port.

    Then set the button's string output to be whatever. example: Button text 'A; = string output 'keypad-A'
  • Joe HebertJoe Hebert Posts: 2,159
    ericmedley wrote: »
    You could setup the buttons on the keypad to 'string output' on whatever port you wish and then look for the text there.

    In TPD4 it's in the Button_Properties- Programming - string Output Port.

    Then set the button's string output to be whatever. example: Button text 'A; = string output 'keypad-A'
    Using the string output is certainly an option but then his code has to do the concatenating and handle the logic which is normally taken care of by the built-in keypad.
    What purpose does the built-in keypad serve at that point?
    Or am I missing the point?

    I use the work around that Marc Scheibein purposed in the thread I posted above but my ears are always open for new ideas.
  • ericmedleyericmedley Posts: 4,177
    Joe Hebert wrote: »
    Using the string output is certainly an option but then his code has to do the concatenating and handle the logic which is normally taken care of by the built-in keypad.
    What purpose does the built-in keypad serve at that point?
    Or am I missing the point?

    I use the work around that Marc Scheibein purposed in the thread I posted above but my ears are always open for new ideas.

    What Joe says is true. I wrote a little module myself that has its own keyboard and keypad for just such a reason.

    I've oft thought a good work around for the whole keypad/board thing would be to simply send the keyp or keyb command to the device : port you want to and the TP would then know to send the data back on that port. Too bad...


    edit note: That's funny. When I origianlly typed device : port I didn't include a space between them and look what happens: device:port
  • viningvining Posts: 4,368
    I normally use the renamed keypad or keyboard method too and just test for the various names in my port 1 TP_Array data event which for port 1 is usually dvTP_Array since I always reserve port 1 for global stuff like this. But you could just as easlily create a global variable and every time you invoke the keypad or keyboard simply set this variable to a number corresponding to a specific device it's used for. Use a switch case or preferably a slecect active on this variable and re-direct it as needed. Send directly to a devices virtual on what ever port you want or just handle it in the data event.

    I've never actually done the variable tracking but it's just as simple depending on where the keypads are pop up. If you're popping it up in a module then you'll need to pass this variable in where as the re-name keypad you won't need to do anything except trap the name in the data event.
  • yuriyuri Posts: 861
    ok guys, thanks for the replies.
    There are off course several work-arounds for this problem, i just wanted to know if there wasn't any option to get the TP to return the data on port 2 (would have been the most easy solution :) )
Sign In or Register to comment.