How to grab webcam "button pressed" event
Hej
Im just getting some example code to work together with JMF. In the example one frame is displaying the
video and a "capture" button captures a picture in the streem and displays that picture in onother frame.
My webcam has a physical button and my goel is to be able to catch the event fired by that button, or in some other way.
Anybody?
thanks / carlos
Use linux, with the proper driver, or your going to have to us JNI, again.
Look for an API for your specific webcam.
Similar Messages
-
How to call a dynamic URL on 'button press' event, in MVC-based BSP
Hi,
My requirement is as below:
On selecting a row in table view, and pressing a button, I need to open a browser.
The Browser URL depends on the row selected.
The key field from table view, is added at the end of the URL string.
Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
In Views Section, there are 2 tags- (1)table view & (2)button.
Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
In Button's OnClientClick method, I have called the Javascript to open the browser.
If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
it will be called only after the browser is opened.
(as OnClick event is executed only after OnClientClick event is executed)
Could anyone please tell me what event (and in which tag) can be used to solve this.
Is there any event which is triggered, as soon as the row is selected, & before the button press event is triggered ?
Would really appreciate responses made to this query.
Thanks,
Nisha Vengal.Hi Nisha,
The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
function fn_button()
htmlbSL(this,2,'b_row_selection:onInputProcessing()');
window.open("new_page",target="BLANK");
Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
Try this out and let us know if it works for you.
Regards,
Saurabh -
How to cach enter button pressing in java 2D API
hi guys,
how to cach enter button pressing in java 2D API
thanks
sivathats input handling -> Belongs to AWT.
Tip-> register an KeyListener and search for KeyEvent.VK_ENTER
lg Clemens -
How to binding a key press event of "Esc" to "cancle" button
I create a class extended JComponent. Than I add a button named "cancle " to it.
Than I add the class's instance to a JDialog object.
I try to get the key press event through add a keyListener to the class instance, but no works.
I try to add a keymap and action map to the dialog 's getRootPane() also no works.
Who can tell me how can I do?Thats the way I did it:
// map escape key
ActionListener escapeActionListener = new ActionListener()
public void actionPerformed(ActionEvent e)
cancelPressed();
this.registerKeyboardAction( escapeActionListener,
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); -
How is when a button pressed a report will come to the same page !!!
Hi all,
I wonder that is it possible to bring a report to the page as a region but only when a button pressed in apex .When ı clicked the go button for example ı want to list a report in the same page.
but I dont know how .If is this possible can you explain me please.I need help!
Thanks!Create your report in a region as normal.
Create a second region and in this region create an item eg p171_item.
In the same region create 2 buttons
Get Report and Reset (branching back to same page).
Create 2 page processes (PLSQL) on submit after computations
1. GET REPORT
DECLARE
v_item number;
Begin
select 1 into v_item from dual;
:P171_ITEM := v_item;
end;
2.RESET
DECLARE
v_item number;
Begin
select 2 into v_item from dual;
:P171_ITEM := v_item;
end;
Tie the processes to the buttons.
On your report region put a condition
PL_SQL RETURNING BOOLEAN
IF :P171_ITEM = 1 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
Now by pressing the buttons the report region is opened and closed.
Now hide P171_ITEM.
Gus -
How to get Radio button select event in my co
Hi,
I want to get the radio button selection event in my co,how can i get the event?Hi,
841475 wrote:
I want to get the radio button selection event in my co,how can i get the event?---There is no event for radio button.
---U need to explicitily set the event for the radio button.
Action:FirePaatialAction
Event:RadioEvent---Get the event in co by below code:
if("RadioEvent".equals(pageContext.getParameter(EVENT_PARAM)))
---In radio button event..:)
Regards
Meher Irk -
How to detect space key pressed event
I am working on a japplet where it is needed to pause the applet on the occurrence of a space bar key pressed event can anybody help
thanks in advanceHave a look at the tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html
http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html
-Puce -
How to handle Button pressed event
Hi,
I need some help in button presing handle event. I have Button B1 and L_1 (it is LOV). I want realize next: When I press button B1 List of value L1 shows, but the value in list is selected it hides. Any help plz.
Thanks.
Edited by: go0ze on 2011.13.6 23:30Hi,
I need some help in button presing handle event. I have Button B1 and L_1 (it is LOV). I want realize next: When I press button B1 List of value L1 shows, but the value in list is selected it hides. Any help plz.
Thanks.
Edited by: go0ze on 2011.13.6 23:30 -
Hi,
I want to add one new row in the matrix ,on pressing the enter button in the item event.How can I do that?
Regards,
KughanHi,
If pVal.Before_Action = falseThen
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
if pval.ItemUID="buttonUID" then
objmatrix=objform.items.item("").specific
objmatrix.addrow
end if -
How can i call key press event for dynamically created texbox
Hi,
I create a one texbox using javascript .now i want to call onFocus event that textbox.How is itI develop grid application using javascript only.When they press add button dynamically add one row and each cell contain one textbox for enter new data.if they want to edit previous data when cursor goes to that textbox,all textvalue is selected format
-
The problem is simple, but i will try describe it the most.
I have a button that triggers an event while it's pressed, and the event must continue executing until the button is released (or at last when released it triggers a second event that stops the first).
I had implemented using mouseEvents, but the button can be pressed hitting a key or, even, automatically. Using actionEvents i don't know how i will know when the button is pressed and when it is released. Using changeEvent i don't know which property changed. There is some kind of property maned PRESSED or something alike?
I searched in forum, but i don't find anything. =(It seems what you are looking for is the "armed" property of the buttons ButtonModel. AFAIK there is no PropertyChangeEvent associated with this property, but when it changes the button will fire a ChangeEvent.
So, you can add a ChangeListener to your button, and in the listener's stateChanged implementation you call isArmed() on the buttons model. Something like this:
static class ArmedStateListener implements ChangeListener {
private JButton button;
private boolean lastArmedState;
public void register(JButton button) {
if (this.button != null) {
this.button.removeChangeListener(this);
this.button = button;
lastArmedState = button.getModel().isArmed();
button.addChangeListener(this);
public void stateChanged(ChangeEvent e) {
boolean isArmed = button.getModel().isArmed();
if (isArmed != lastArmedState) {
// The armed state changed. Do what you need to do here.
System.out.println("isArmed = " + isArmed);
lastArmedState = isArmed;
}To use it, just do:
JButton button = ...
new ArmedStateListener().register(button); -
How to invoke a key press event in application that has focus
Even though I know there are programs out there already that do this similar function, I want to write my own program that converts MIDI events into keypresses. Here is how it would work:
- my program does not have focus, some other app has focus while my app runs in the backround
-a midi event happens
-a mapping is done by my app running in the backround: midi event->keypress
-my app causes a keystroke event to be sent to whatever application has the focus.
my problem:
The part I am having trouble figuring out is how to invoke a keypress to the application that has the focus. Can someone shed some light how this would be done? I have learned a little about the Text Services Manager but this just a component of Carbon. I'd think that I needed to talk to a much lower level part of the operating system to be able to send a keypress to ANY app that is running.
I would prefer to work in Carbon, c++
The thing that would make my midi-keystroke program different from others out there is a much more complex mapping algorithm between the MIDI event and the keypress chosen. That's why I want to write my own.
Thanks much anyone who can help!!
Jayquartz event services contains the calls needed to perform this function
-
How can I call my chart in Forms6i on When Button Press Trigger?
Hi Friends,
I have make a chart in Graphic Builder 6i and save on path C:\graph\test.ogd
Now I want to run this Chart from Form6i on When Button Press trigger.
I have call my report in forms using this command on When Button Press trigger.
Run_Product(reports,'C:\Cheema\Qdir_store\reports\pmms\sec_backlog',asynchronous,runtime,filesystem,TO_CHAR(NULL));
So tell me How can I call my chart in Forms6i?
Please reply me on urgent.
Thanks,
ShahzadJust to recall after a long break of couple of years..... Pls check out if not wrong.
First of all you need to embeed the chart object on your layout window and make it visible = FALSE. This is a design time work. In the button press event, show the chart object by setting the visible property = TRUE.
Note, i could not paste u the sample code as i don't have forms installation on my PC. The above states is a logic you can apply. -
Problem while hide a block on selection screen on button press
Hi,
I have added two buttons on the application toolbar of the selection screen. I have input fields under two blocks on the selection-screen. Initially the second block is hidden. If I press the button 1 the second block should be made visible.
For this to happen, I captured the button 1 click event using the following statement.
IF sscrfields-ucomm = 'FC01'.
Inside the if ... endif, I looped at the screen and made the second block visible. It was working fine.
loop at screen.
if screen-group4 = '013'.
screen-invisible = 1.
screen-active = 0.
endif.
endloop.
Later the second button was added. Now when i run the report for the first time, if button 2 is clicked the hidden block appears on the selection screen even though i have not added any code for it.
Just to check, i commented the logic to display the hidden block on button 1 click event. Even without any code the first time i press any of the two buttons added on the application toolbar the hidden block is displayed.
I saved a variant for the report.
During execution of the report, if i select any variant then the hidden block is displayed.
Can anyone please tell me how to fix this problem.
Regards,
T2.Hi All,
The problem is solved.
Everyone was confusing between the pushbutton on the selectio-screen and on apllication toolbar
(where you have the execute icon).
Please find the code below. Thanks for you time and help. I appreciate it.
REPORT ztest.
INCLUDE <icon>.
* TABLES *
TABLES: t001, " Company Codes
lfa1, " Vendor Master (General Section)
sscrfields. " Fields on selection screens
* To capture button press event.
DATA: gv_button_press TYPE c.
* Menu Painter: Program interface for dynamic texts
DATA: gs_dyntxt TYPE smp_dyntxt.
* SELECTION SCREEN *
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-s01.
* Company Code.
SELECTION-SCREEN BEGIN OF BLOCK ccode WITH FRAME TITLE text-s02.
SELECT-OPTIONS: s_bukrs FOR t001-bukrs OBLIGATORY MEMORY ID buk.
SELECTION-SCREEN END OF BLOCK ccode.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK dsel WITH FRAME TITLE text-s04.
* Vendor Master.
SELECTION-SCREEN BEGIN OF BLOCK vend WITH FRAME TITLE text-s07.
SELECT-OPTIONS: s_konzs FOR lfa1-konzs MODIF ID aw1.
SELECT-OPTIONS: s_txcd1 FOR lfa1-stcd1 MODIF ID aw1.
SELECT-OPTIONS: s_txcd2 FOR lfa1-stcd2 MODIF ID aw1.
SELECTION-SCREEN END OF BLOCK vend.
SELECTION-SCREEN END OF BLOCK dsel.
* INITIALIZATION *
INITIALIZATION.
* Populate the Application toolbar button attributes.
PERFORM populate_app_toolbar_buttons.
* Hide the dynamic screen intially.
PERFORM hide_screenfields.
* AT SELECTION SCREEN *
AT SELECTION-SCREEN.
* Capture the button press event.
PERFORM capture_button_press.
* AT SELECTION-SCREEN OUTPUT. *
AT SELECTION-SCREEN OUTPUT.
* Show/Hide the dynamic selection screen based on button press.
PERFORM adapt_screen.
*& Form populate_app_toolbar_buttons *
* Display Icon on the application toolbar buttons. Also set the *
* function codes for these buttons. *
FORM populate_app_toolbar_buttons.
CLEAR gs_dyntxt.
WRITE icon_fencing TO gs_dyntxt-icon_id AS ICON.
MOVE text-b01 TO gs_dyntxt-quickinfo. " Dynamic Selections
MOVE gs_dyntxt TO sscrfields-functxt_01.
ENDFORM. " populate_app_toolbar_buttons
*& Form hide_screenfields *
* Initially hide the Dynamic selection screen. *
FORM hide_screenfields.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " hide_screenfields
*& Form capture_button_press *
* Set the flag based on button press event. Appication bar button *
* tcode is available only at 'At Selection-screen' event. *
* Use the captured data at 'At Selection-screen Output' event. *
* Screen adjustments is possible only under this event. *
FORM capture_button_press.
IF sscrfields-ucomm = 'FC01'.
IF gv_button_press IS INITIAL.
gv_button_press = 'X'.
ELSEIF gv_button_press EQ 'X'.
CLEAR gv_button_press.
ENDIF.
ENDIF.
ENDFORM. " capture_button_press
*& Form adapt_screen *
* Show/Hide the dynamic selection screen based on button press *
* captured at 'At selection-screen' event. *
FORM adapt_screen.
* If button press flag is initial hide the dynamic selection screen.
IF gv_button_press IS INITIAL.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
* Elseif button press flag is 'X' show the dynamic selection screen.
ELSEIF gv_button_press EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'AW1'.
screen-invisible = '0'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " adapt_screen
Regards,
T2
Message was edited by: Titu Joseph -
Disabled button fires events to event structure
Hi all,
I was trying to disable a Button on the frontpanel by using its enabled property while the event was executed. The ide wa not to create more events of this buttopn while its fucntion was executed. However thsi did not work.It was creating events even though it was greyed out.
I troied two different versions:
1) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and then enabled it again
Result: All events were generated even though the button was greyed out
2) in the event case of the button (value changed) in a sequence I disbaled the Button and then started a second event. The Second event executed the code and then enabled the Button egain
Result: Even though the Button was greyed out events were generated
3) in the event case of the button (value changed) in a sequence I first dispalbned the button, execuded the code and in the timeout event I thenenabled it again
Result: No additional events were generated
it seems that the enable state of the button is analysed at teh time when the event is execute din teh event case but not at the time when it was created?
So I Tried the Time Input of the case expecting that it woudl give me a time stamp of the time when the key was pressed - but instead it gave me the time point when teh event was executed...
Teh only othe rsolution was to set teh cursor to busy (however I dont want to see the changed cursor during the busy cycle)
So how can I make shure that no additional events are fired during the time teh code of the Button s executed?
Thanks for any help,
Rainerto altenbach:
The evet takes about one or two seconds - I checked the behaviour as shown in the attached examples with LV 8.5, LV 2010, TV2011, LV2012 - allways exactly the same behaviour.
It does not make any difference weather you use switch when pressed or latched when pressed.
It does not make any difference weathe ror not you tag "Lock front panel" for that event
to sth:
> If you disable a front panel control (ie the button) you cannot click on it and a value changed event will not be
generated.
This is my experience so far as well, but if you disable and enable the control within the same event it does not work (see attaced example 1) and 2). It only works if you do the enable in the timeout event.
> The time stamp from the event case left hand property is the time of the event not the time of execution.
> If you ask for the timer value inside the event case it will be the time of event case executing.
In the attached exampel this is not the case. The time differecne between the Time input on the left and the Tick count
placed in the event is 0 for all events generated whil the button is supposed to be disabled.
As I wrote before, the explanation I have for this behaviour is that the events are generated by windows weather or not
the button is disabled and they are queued to the event cue. Only when the event is handeled LabVIEW tests weather
or not the button is disabled and ignores the event in case it is disabled. If the Disabling and enabling is done
withim the same event the button pressed events are added to thw event queue and the button is set to enabled before the next event (button pressed while it shoul be disabled) is handeled. When that event is handeled the button is enabled again (by the original event) and therefore the evenet is not ignored (because by the time of execution of the event the button is enabled again).
If the button is enabled in the timeout event instead of the button change value event all event in teh queue are executed before teh timeout event. At their time of execution therefore the button is steill disabled. Only then the timeout event enables the button again.
If the vi is set to busy (sand clock) this is activating actually a windows function/property and no events are queued to teh event queue by windwos. Therefore no button change event is added to teh queue.
Funtciomn of the 3 attached Vis (LV 2010):
Run the Vi, then press the Test button once - when it is greyed out click it a few more times. The test button value
changed event has a 2 second delay. You will see the event counter increase, and you will see the time difference
between the time property on the left of the event and the tick count vi whci is displayed in the waveform chart.
DisableButton 1: Disable and enable are ste in teh same event
DisableButton 2: The button is disabled then a second event is called to do the work and then enable teh button again
DisableButton 3: The Button is disabled in button change value event and it is enabled again in teh timeout event.
Attachments:
DisableButton1-3.zip 29 KB
Maybe you are looking for
-
PDF text does not display properly
My coworkers made a PDF (using Acrobat Pro and MS Office on Windows) that displays properly in Windows, Mac, Android, and iPad (iOS 6). However, on two different iPhones (v3 with iOS 3, v4 with iOS 5) the PDF displays with no text and only black grad
-
When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators. Excel allows you to do this during the import.. Is there a way to accomplish this i
-
Please help!!!! dataload problems for G/L
Hi everyone I could really need your help with this. I have to get a Greek General Ledger dataload into SAP. Unfortunately it contains Greek chracters in the excel file and I copy and paste the entries into notepad and save it as Unicode. When I try
-
Using templates inside a project
Hello, I have a LV Project and I have a folder inside my project named Templates. Inside the Templates folder there are a few template VIs I made with names "Template_Name.vi" specific to that project. Now and then I need to copy a few templates file
-
How can I find out when I purchased my mac?
Title says it all. I know you can check to see if you are still under warrenty, but it does not tell you when you purchased your mac. Thanks! Oh, I've also updated my OS several times. I know there are some ways, but if you have updated you can't do