Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [event-handling]

Event handling is a coding pattern related to acting on messages between a source and one or more subscribers. A point listener in the source provides a way in which subscribed code can consume messages raised from the source.

1
vote
1answer
49 views

ASP.net service that sends email whenever an entity is updated [closed]

I have an ASP.net MVC5 project which involve different domain services, and one of it are EmailService which will send email if entity is updated. ...
8
votes
0answers
173 views

Windows keylogger in C++

Windows keylogger in C++ Known issues: Not implementing rule of five Having to use hack to use member variables, out_, in static method Pressing caps-lock won't ...
0
votes
1answer
80 views

Updating values in a database

I'm using standard jQuery Ajax to update values in the database and reflect the result in an output. This repetition seems like bad practice and I don't know enough about jQuery to consolidate this ...
1
vote
0answers
13 views

ReactJS code that allows at most one profile pic to be selected

I am making a profile picture selection screen, basically you select a picture pic1, if another picture pic2 is selected, then we cancel the highlight of pic2 and highlight pic1. Here is my code right ...
2
votes
1answer
28 views

De-bouncing a (Gray) Rotary Encoder Switch in C

I would like feedback on the correctness and performance of this code. My priorities are also are readability, simplicity and self-documenting code - but I'm happy with those as they are. I still ...
0
votes
0answers
60 views

Golang message bus for a game engine

I wrote a memory bus struct in golang to allow systems to interact with each other without knowing anything about the receiver. This is for a game engine. I know it's not good to write games in ...
3
votes
1answer
83 views

Drawing shapes in a GDI window

I've been tasked with writing a windows form application that offers some options to modify the drawing of shapes within another window. I have very little experience with event-driven programming and ...
1
vote
0answers
28 views

Modeling the Aggregates in the following Bounded Context - Domain Driven Design

I'm currently developing an application in ASP.NET Core 2.2 with Domain Driven Design. What you see in here is a Unit Creation page. A Unit is composed of competences. A unit must have at least one ...
1
vote
1answer
52 views

Keypress output to screen

For a school project, I had to make a keylistener that would output whatever you typed to the screen. A JFrame would be initialized to have the focus required for the listener to work. It uses delete ...
1
vote
1answer
44 views

Monitoring navigation function: logic judgment

Write a simple monitoring navigation function. I feel logic judgment still needs to be optimized. I don't have a clear idea right now about code logic such as reducing ...
1
vote
2answers
137 views

Simple menu with descriptions

If one menu-item is clicked then the description with the same data-filter attribute should be shown. I added a class to the description elements to associate each one with the affiliated menu item. ...
2
votes
0answers
73 views

Observer(Event) system (Signals and Slots), type and template based

Signals are represented as types. You can connect a member function of some instance to the Observer system. This connected function will be called whenever a signal of a type that is the same type as ...
5
votes
1answer
42 views

Mouse control of a camera in an OpenGL program

Introduction I'm doing an OpenGL program in C. As of now I'm working on the 3D camera system and got the control right. Now I'm working on the mouse control. It works, but I have used two different ...
3
votes
2answers
138 views

Lazy-loading iframes as they scroll into view

I'm working in a Tableau driven system, with large numbers of charts, I needed a way to reduce the strain of the initial load of our app. It's fairly simple, but wanted to ensure I accounted for every ...
2
votes
1answer
113 views

Event system implementation with Listener and a static Manager

I am trying to create an event system that would be quite easy to use. The idea is that a user would only need to create a custom function and tell which event should fire that function. It works as ...
3
votes
0answers
60 views

“Lock-free” one-shot event manager

Giving a review to Oachkatzl and recently about some other synchronization problems (Lazy with invalidate and some node-locking list), I wanted to test my skills and redesign it in most light-weight ...
7
votes
1answer
149 views

Threadsafe oneshot-event which fires on subscription if the event was fired in the past

Assumptions Basically, a Connection class has a "Disconnect" event. Subscribing to this event isn't thread-safe, because the disconnection may fire from another thread right before I subscribe. So ...
2
votes
2answers
102 views

Simple event mechanism

I am working on a simple event mechanism for c++. Since Iam not very experienced I would like to share my code in order to get some thoughts. I also dont like the BIND_X macros. Ideas how to ...
3
votes
1answer
57 views

Toggle Event Delegation

NOTE: the Javascript is all I'm concerned about, the HTML/CSS is just DEMO code. One caveat is ARIA states or attributes, if you have input on that, by all means, dive in. I had the need for and ...
2
votes
0answers
103 views

C++ Generic Action Dispatching & Handling System

I am trying to achieve an event system, which I refer as actions, and would like your ideas about what I come up with so far. I have made research on several design patterns, and several systems used ...
2
votes
2answers
1k views

Form for OTP entry with six single-character text fields

I am working on an app in which I have to pass 6 digits OTP through 6 textFields in which you to provide only one character and after that it automatically goes to ...
1
vote
1answer
88 views

Event Handling Gamepad in Java

Context This program will control a robot. It is written in Java 7 and compiles into an Android app, but these classes are not Android specific. This program was written for FIRST Tech Challenge and ...
4
votes
0answers
148 views

C++ game engine event system implementation

I am currently working on the implementation of Event System on a game engine. I have zero experience in Event System implementation or the patterns that are used. What I have done is what I've seen ...
0
votes
1answer
110 views

Double loop for input handling

I'm writing a simple game with multiplayer mode in C++, using the SFML framework. Since I don't want to make it more complicated than necessary, I handle everything on a single thread, so that when ...
0
votes
1answer
25 views

Activate submit button on form change and detach event listener

We have pages that contain 1-3 forms. Each form does have a submit button which is styled as inactive* as long as the user didn't change the form. Now I need to: remove the class from the button as ...
4
votes
1answer
88 views

Simple C++98 actor system (with event system) - think Doom or Unreal

I am finishing up an actor system (like those used in 90s games, like Doom, Unreal, etc.), which currently deals with damage and event handling. actor.cpp ...
0
votes
1answer
34 views

Throttle redraw requests fired from pointer events

I am working on a photo editor, which displays a preview to the user on a canvas. At various points in the app, the user may use sliders to adjust properties of the photo, such as scaling, rotation, ...
6
votes
2answers
86 views

Event emitter npm module

I was asked to complete the task described below: Event Emitters are objects that serve as the core building block in event-driven architectures. They simplify the process of handling asynchronous ...
0
votes
1answer
33 views

Manager that collects and handles multiple tasks that run on events like window.scroll, window.resize etc

I'm working on a website where different things can occur on resize and scroll events. I only want one event handler that comes ...
2
votes
2answers
102 views

Subscribe to Event form one service to another

In my architecture I have service layer, and for my question two relevant classes in this layer: UserManagementService EmailSenderService In first service there is method: ...
5
votes
1answer
419 views

Angular directive to disable a button when clicked, allowing re-enabling as needed

I have written an Angular Directive that disables a button after it has been clicked, to prevent double posting / saving of data. This works fine in most of our use cases. However, in some situation ...
1
vote
0answers
51 views

Message loop handler functions, using associative array and using switch

I am using the Windows API to register system-wide hotkeys. This requires a message loop to be created, and a handler to handle the hotkey messages. I have written two pieces of functioning code. The ...
2
votes
1answer
100 views

To Do List using basic JS

I learned javascript from some tutorials and as per advice, I thought of creating some task by my self. I wrote the following code and as I expected I saw the answer. If someone can assist me with how ...
4
votes
1answer
368 views

Simple event dispatcher

Here is my very first event dispatcher. I would like to get both, style and code review, as well as some ideas to improve this implementation (new features etc.) I tried to write code in C++17 style ...
3
votes
1answer
44 views

Lightweight Java Event Handling Interface

I've been looking for a simple way to manage event passing between classes and, like many others, have found the whole addXxxxListener paradigm to be tedious and ...
1
vote
0answers
247 views

Using postMessage() in JavaScript with iframes for cross domain communication

I am trying to enable communication via JavaScript from an iframe and its parent window when they are on different domains. I did a lot of research and it turned out that ...
1
vote
1answer
100 views

JavaScript debounce function

I built one JavaScript debounce function. I need a JavaScript expert's opinion if this is the correct way to do it, and if not, then what the flaw is in this current function. ...
2
votes
0answers
456 views

PyQt frame which changes color with child focus

I am working on an application that has various "panels" contained within splitters. I wanted the panel border to change color when one of it's children gained focus. Here is a simple example of the ...
3
votes
1answer
69 views

on() event handler for multiple objects [closed]

I'm using three instances of ace editor in a form. I initialize them like so: ...
0
votes
1answer
619 views

Handling keyup events with throttle or debounce in Javascript/jQuery

In my web application, there is a search input field, and when the user empties all of the text inside the input field, there is an API call made for a default-list of results, which are displayed in ...
2
votes
2answers
72 views

Manipulating the browser history

I created a table with the ability to edit with popup. This part of the code, which includes: the ability to send URL to other users with the subsequent opening of the same state (the popup window ...
3
votes
0answers
156 views

Media player subtitles in WPF - Part 2 Handlers and notifications

This is a continuation of Part 1. In this question I will present you with a single class which is the most crucial component of the whole system, it's responsible for firing notifications whenever a ...
5
votes
2answers
581 views

One more C++ event system

This is an event system implementation for C++. GitHub I'm targeted on following features: RAII-friendly any number of event parameters ability to use member functions, free functions and lambdas ...
1
vote
2answers
213 views

C# style Event and Delegate in C++

I'd appreciate advice regarding both the implementation detail and ways to improve usage/performance/generic. There are two parts: XDelegate, which is I got from ...
4
votes
2answers
10k views

Binding a keyboard key to a Tkinter button

I'm specifically asking about binding a keyboard keystroke to a button in a GUI. Originally I planned to bind the keystroke to the GUI button itself, but that seemed impossible, and potentially unwise ...
0
votes
2answers
80 views

Attaching a click handler in a cross-browser way

I have been attempting to have a method call, with a parameter, inside of a ternary operator to simplify some code. Code: ...
1
vote
1answer
105 views

Custom observable types and their supporting classes

I decided that for some parts of my project, communication through events would be very handy, for that purpose I started writing the most basic part of the event system, an interface consisting of ...
4
votes
1answer
357 views

Complete ObservableDictionary

In conjunction with a recent question of mine, I found that an ObservableDictionary would be very handy for my situation, so I decided to implement one. I've ...
1
vote
1answer
4k views

onChange vs onKeyPress for input in React

I have an input form, and when you press enter I want it to call a function. I was wondering what "the right" way of doing this is. Right now I have an input looking like this: ...