SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-14-2007, 05:00 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Using Keystroke API call...how do you send non-printable chars?

I'm assuming that this call allows you to send all keypresses, including up arrow, down, right, enter, pageup, pagedown....but how do I know what the string is that represents those? Is there some master table somewhere?
Reply With Quote
  #2  
Old 12-14-2007, 05:07 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I suspect you would look here.
Reply With Quote
  #3  
Old 12-14-2007, 05:32 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The key names are from Java's java.awt.event.KeyEvent.

You can hard code names like "Left", "Alt", "F4", etc.

If you want to make sure the text gets localized, you could probably use the KeyEvent's getKeyText() and getKeyModifiersText() calls to get the names of the keys you want, using key values like java_awt_event_KeyEvent_CTRL_MASK or java_awt_event_KeyEvent_VK_LEFT.

The default STV uses java_awt_event_KeyEvent_getKeyModifiersText() to assign keystroke commands depending on which Hauppauge remote is selected.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #4  
Old 12-18-2007, 12:05 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Excellent, thanks! I see it now.
Reply With Quote
  #5  
Old 02-08-2008, 11:28 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Well ok....I thought that I saw it...

The good news is that I am able to pass a keystroke through...the bad news is what it does.

If I pass through "Down", and I set false so that it sends only to Sage, then what happens is a dialog box comes up, with the letter D on it. If I send "Escape", it does the same, but with E. So, I figured out that it's literally sending the letter "D" and "E", and that causes the dialog box to come up like you're entering search text.

If I change the parameter to true, though, so it sends it to the system instead...then it works on whatever window I have up. So, "Escape" actually does escape out of that window, "Enter" selects the highlighted item....it works great.

So, the text I'm passing to the Keystroke utility call works like it should on the system, but when I use it on Sage only, it doesn't. Any ideas?
Reply With Quote
  #6  
Old 02-10-2008, 12:59 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Greg, or someone....can you test the Keystroke utility API function in Sage and confirm it works? When I send it a keystroke name (say "Escape"), it works on the system level (flag set to true), but on the sage only level (flag set to false), it instead seems to register the actual letters of E-s-c-.....

* merged *
Reply With Quote
  #7  
Old 02-10-2008, 01:36 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by beelzerob View Post
Greg, or someone....can you test the Keystroke utility API function in Sage and confirm it works? When I send it a keystroke name (say "Escape"), it works on the system level (flag set to true), but on the sage only level (flag set to false), it instead seems to register the actual letters of E-s-c-.....
I saw your other thread about this. I'm not sure why you think it's relevant to this thread, but I don't have any special insights about how it's supposed to work. (If I did, I would have replied on the other thread.)
__________________
-- Greg
Reply With Quote
  #8  
Old 02-10-2008, 01:45 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Oh.

I asked here because I'm using your API utilities to do this, and so I considered that maybe there was a disconnect in your utilities and the actual Sage API. I thought using your utilities made it relevant.

I'll find my answers elsewhere.
Reply With Quote
  #9  
Old 02-10-2008, 02:37 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Sorry, I didn't mean to be short with you. If you have some reason to think the bare API function works but the wrapper is broken, then yes, that would be relevant. But my impression was that you hadn't managed to get even the bare function to work. Maybe I misunderstood that part.

If there's any doubt about whether the wrapper is at fault, try testing the bare function in Studio widget code or Expression Evaluator. I find this to be a much more efficient way of learning how an API works than multiple compile/debug cycles of trial-and-error in Java.

Finally, this may be a dumb question, but why would you want to do Keystroke("Escape", false) when you can do SageCommand("Options") instead? Seems to me that using command names would be preferable in cases where the user may have remapped keystrokes.
__________________
-- Greg
Reply With Quote
  #10  
Old 02-10-2008, 09:28 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Heh..your question is no dumber than mine. I'm just trying to implement what the users are asking for. I honestly don't use my interface at all, so I don't know enough to know what a good substitute would be.

I think what they want is just to be able to pass some basic interface actions through. They want to be able to navigate the Sage interface using their own interface. So, they can move down a menu sending the "Down" keypress repeatedly, then select is using the "Enter" keypress. It's crude, but it's oft requested.

I'm still a complete newb to the Studio...though that's about to change. If I were more familiar with it, I probably would have thought to use the express. evaluator. I'll try that from now on first...and I did just try it, and it fails to work for me there, too....so I'm back to not knowing how the Keypress API call is supposed to work.
Reply With Quote
  #11  
Old 02-11-2008, 12:49 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The best thing to do if you run into API calls that don't seem to function properly is to report it to SageTV. I sent in a question about this & was told it should now be fixed for the next update. Try it again when the next version is posted.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #12  
Old 02-11-2008, 02:55 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Quote:
Originally Posted by Opus4 View Post
The best thing to do if you run into API calls that don't seem to function properly is to report it to SageTV. I sent in a question about this & was told it should now be fixed for the next update. Try it again when the next version is posted.

- Andy
Oh, thanks!

I didn't want to bother Sage with this...I figured just about the LAST possibility was that the command was actually broken. I was sure I was just doing something dumb.

How would I report this, in the future? With the bug submission form you have linked in your sig?
Reply With Quote
  #13  
Old 02-11-2008, 03:00 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by beelzerob View Post
I didn't want to bother Sage with this...I figured just about the LAST possibility was that the command was actually broken. I was sure I was just doing something dumb.
It doesn't hurt to post about it, but if no one knows an answer, send it to SageTV.

Quote:
How would I report this, in the future? With the bug submission form you have linked in your sig?
Yes, that would work. It is on the main forum page too.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #14  
Old 02-11-2008, 04:04 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Ok, thanks. And by trying the next posted release...you mean the next version beyond 6.3.8?
Reply With Quote
  #15  
Old 02-11-2008, 04:10 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by beelzerob View Post
And by trying the next posted release...you mean the next version beyond 6.3.8?
yes
Reply With Quote
  #16  
Old 03-02-2008, 08:20 AM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
I just tried 6.3.10. It's better, because now when I pass "Escape", it doesn't open up the search text box. However, it also doesn't pass the Escape key in. It doesn't seem to do anything for me. If I pass "Down", nothing happens. I had expected that it would move the menu selection down.

Maybe I don't understand what the Keypress API call is supposed to do. Basically what I'm trying to do is allow them to navigate the menus in a generic fashion.
Reply With Quote
  #17  
Old 03-02-2008, 02:08 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
It still seems to me that the most generic way to navigate menus is by using SageCommand instead of KeyPress. That way you don't need to worry about which key invokes which command in which menu (e.g. Left means Back in the Recordings menu but not in the Program Guide); just use the command names directly.

KeyPress may be what your users are asking for, but that doesn't mean it's what that want. What they want is most likely something like SageCommand, i.e. a reliable, keyboard-independent way of navigating menus that the user can't screw up by remapping keys. They just don't know enough to ask for it by its proper name.
__________________
-- Greg
Reply With Quote
  #18  
Old 03-02-2008, 07:43 PM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Well, lemme take a look at that, perhaps it would be overall better....but I know some of these guys will simply want to be able to move the lighted selection bar up and down and select things, as opposed to being taken directly to the screen they want. They're weird like that.

Is there an overview of everything that can be passed to SageCommand? It takes a string, and the API description doesn't list what strings are valid. I know "Home" and "Stop" are two of them, but that's it.
Reply With Quote
  #19  
Old 03-02-2008, 09:42 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by beelzerob View Post
Is there an overview of everything that can be passed to SageCommand?
Just use the names of the commands listed in Detailed Setup -> Commands -> Link Command.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #20  
Old 03-02-2008, 09:47 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Or see Chapter 5 of the manual. Basically any action you can take in the UI is covered by SageCommand. Sage handles keystroke input by looking up the keystroke mapping and passing the result to SageCommand, which does the actual work.
__________________
-- Greg
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTV V6.3 is now available for Win/Linux! Narflex Announcements 1 03-07-2008 12:33 PM
A "Void" API Wirenut SageTV Studio 3 12-10-2007 11:45 AM
SageTV V6.3.2 Beta is Available! Narflex SageTV Beta Test Software 0 11-21-2007 07:08 PM
SageTV V6.3.1 Beta is Available Narflex SageTV Beta Test Software 1 11-09-2007 05:17 PM
Having trouble handling what an api call returns... beelzerob SageTV Studio 2 05-31-2006 07:45 PM


All times are GMT -6. The time now is 06:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.