events

jquery live event for added dom elements

I want to add a class to any DOM element that is on the page now or in the future that has a specified class and meets some criteria so for some pseudo code $('.location').live('load',function(){ if($(this).find('input:first').val().substr(0,1) == "!"){ $(this).addClass('hidden')} }); of course this does nothing EDIT NOTE this ...

Disable All Events on a Windows Form

Is there any way to temporarily disable ALL events on an windows form? I have situation where processing on a secondary thread is being corrupted by events on the main thread. (The main thread events are modifying the contents of controls that are data-bound to variables used by the secondary thread.) Looking for a way to "lock" the...

How to use toggle event with live?

I have the following code $(".reply").toggle ( function () { x1(); }, function () { x2(); } ); I need to use live, so new elements would also be bound. Is there some syntax to do it? Or will I need to implement a toggle on the click event? I am using jQuery 1.4.2. ...

google maps api v3: where is the load event

Which event will to the same that the load event did on the api v2 spec? Right after the map is initialized, calling to getBounds().getSouthWest() will return null. Thanks ...

call event from form2 in form1

hi call event from form2 in form1? for example : The following code into form2 : private void Form2_Load(object sender, EventArgs e) { MessageBox.Show("http://stackoverflow.com"); } What to write in a form1? ...

Events and Windows Forms controls

I want to implement some kind of MVC pattern in C# for loading some data stored in files. I want my loader class to signal other classes when the loading has started, when a piece of the work has been done (read a line from the file for example, to update the progressbar in a form or other ways to show elaboration progress), when the dat...

Javascript Regular Expression [Remove Events]

Hi, does anyone know of a good regular expression to remove events from html. For example the string: "<h1 onmouseover="top.location='http://www.google.com"&gt;Large Text</h1> Becomes "<h1>Large Text</h1> So HTML tags are preserved but events like onmouseover, onmouseout, onclick, etc. are removed. Thanks in Advance! ...

Android MapView stops generating (or receiving?) events...

I'm working on an Android class that extends MapActivity. I have set the OnTouchListener and everything works okay for the first MotionEvent. After the first MotionEvent, the system stops either generating MotionEvents or receiving them or both. Does anybody know what I have to do to keep receiving MotionEvents? Thanks. @Override public...

how to handle "ctrl + s" event on chrome and ie .using jquery .

i can use this code to handle "ctrl + s" on firefox : $(window).unbind('keypress').keypress(function(event) { if (!(event.which == 115 && event.ctrlKey)) return true; $('#save').click(); event.preventDefault(); return false; }); but , it ca...

ActionScript - Accessing TextField Context Menu Events?

TextField objects have a built in context menu containing items which target cut, copy, paste, delete and select all events. i would like to map keyboard keys and modifiers to these events to obtain their free functionality. is that possible? ...

Stop page from scrolling when intercepting key presses like space and arrows

I'm using JavaScript and Prototype and catching the key presses from the user. I successfully catch return, space and arrows with code like this: Event.observe(window, "keyup", function(e) { switch (e.keyCode) { case Event.KEY_RETURN: case Event.KEY_RIGHT: case 32: // space // do something break; } }); My ...

Control events into commands and RX

Hi We have some WPF/Silverlight controls we have written using the traditional event architecture (no commands etc.), and want to convert it to MVVM compliant ones. I researched on this subject, and i take it i will have to write commands to wrap the events that i currently have in the control. I would like to design it correctly now so...

Event data passing in the inline event handlers

I have an <input> which has an onkeydown inline event handler. In this handler, I'd like to call a function and pass a special parameter to it - the event data. When I want to handle events (e.g. onmousemove) for the whole document, I use the following code: document.onmousemove=function(e) { // here I can make a good use of the 'e' va...

Is my approach to assign values to an instance of custom EventArgs recommended?

In my current situation I have a class that performs an operation synchronously. During that operation an certain event will the thrown several times, depending on how often the situation where the event is raised occurs. I know how the event-mechanism works and what the recommended ways of using are. Works well.(Note: My application is ...

Performance implications of .net Events

We were having a discussion at the office on how to solve a particular problem and using an event was raised (no pun intended). The response was negative citing misuse and that they can be expensive. I understand the concerns behind misuse and I know that they are just a special multicast delegate but given a scenario where there is at ...

How to unit-test an event loop?

Hi there, I'm programming an HTTP proxy in Python (transparent proxy for request/response monitoring). But as a TDD adopter, I'm starting the project with HTTP inputs that should be caught by a TCP server. But, as any server, it must run within an event loop, so that it can listen in a specific port. Well, since starting the event loop...

How do I temporarily disable/bypass the Android OnTouchEvent

I'm currently using the event @Override public boolean onTouchEvent(MotionEvent ev) { To provide feedback from the user for game I'm writing. This event fires off some game control events that take some time to complete (because there is animation involved). The problem I'm having is during the animation if I keep touching the scree...

Silverlight - detect what is under a pressed button

Hi I am creating a card game in Silverlight. Each player has a Hand which contains multiple cards. A card is a customised button e.g. public partial class CardButton : Button When a player has 2 or more cards of the same rank, I want a mechanism to be able to select both of them. So I have attached a mouse over event to each card,...

OSX Leopard keyboard input API other than cocoa

Hi, I am currently trying to get simple keyboard input on OSX, right now I am doing it through the Leopard HID Manager object and that generally works, but since that is pretty low level I am wondering if there is an API available that has some extra functionality build it like key repetition or Unicode support (since when I catch the e...

How to prevent browser's default history back action for backspace button with JavaScript?

Hi, Is there a way to prevent the default action from occurring when the user presses backspace on a browser? I don't need to prevent the user from leaving, just from having the default backspace action. I need the backspace to do something different (it's a game). I tried without success: window.addEventListener('keydown', function(e...