Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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.

Filter by
Sorted by
Tagged with
37 votes
5 answers
3k views

When "How To Ask" is too subtle

This is the first JavaScript code I've ever written, alert("hello, world!"); aside. This site is closing quite a lot of questions because people won't read the ...
Mathieu Guindon's user avatar
28 votes
1 answer
76k views

Use of Async/Await for EventHandlers

I have a MVC WinForms application. I am using Dependency Injection with Ninject as the IoC container. ...
MoonKnight's user avatar
19 votes
5 answers
7k views

Using sounds in Java

I'm trying to apply sound today, and the goal in mind was a simple violin tuner. The actionListener seems repetitive/ How might I optimize it (what I tried just ...
Legato's user avatar
  • 9,829
18 votes
2 answers
4k views

Using events together with interfaces in VBA

Introduction Because of the limitation of VBA in using events in interfaces I was searching for a kind of workaround. For sure I also read this which also provides an approach, but I was searching for ...
AHeyne's user avatar
  • 428
18 votes
2 answers
30k views

Generic EventArgs to go with generic EventHandler?

There is as of .NET 2.0 a generic EventHandler delegate type, which can be used to define an event in terms of the EventArgs ...
KeithS's user avatar
  • 1,695
14 votes
3 answers
5k views

Simple event management system

In an effort to rid my code of jQuery, I wrote a custom global event management/handling system. I was expecting this to be hard as, from what I've read, most people don't create their own. It's far ...
willlma's user avatar
  • 273
14 votes
1 answer
6k views

My Event-handling system

I have written about 180 lines of code that implements an Event system. I would like a general review about the code and I'd love comments about the usability of it. (Is the code useful? Would you ...
Simon Forsberg's user avatar
14 votes
2 answers
360 views

Emulation of SE's text input control for tags

Introduction I used React to write a component, which is meant to be a faithful emulation of the input for "Tags" which you see at the top of every question/topic on SE. Why this project? If you're ...
ChrisW's user avatar
  • 12.9k
14 votes
1 answer
35k views

Click event function that checks to see if form field is valid

What I'm building is a URL builder. A marketing person inputs a URL and can test that URL to see if it's valid, then they select a demand channel and then hit 'Generate Campaign URL'. I've omitted the ...
Blexy's user avatar
  • 540
13 votes
2 answers
833 views

Setting up radio button click ActionListeners

Instead of writing four almost identical setOnClickListener method calls, I opted to iterate over an array, but I'm wondering if this was the best way to do it. Do ...
user avatar
13 votes
1 answer
2k 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 ...
user644361's user avatar
11 votes
7 answers
2k views

Too-high / too-low guessing game in Swing

I have created this program and it works fine. It's just that its too wonky and huge so I was wondering if anyone knew how I could shorten the program so I didn't have to put all of these into each ...
user avatar
11 votes
2 answers
9k views

Event Listener and Publisher

This is my first attempt at creating an event system. My plan is that upon publishing, the listener receives both a reference to the model and to the publisher. This allows the publisher class to ...
flakes's user avatar
  • 1,925
11 votes
2 answers
2k views

CAT: Cat Approved TUIs

Cat Hello everyone! I am working on this TUI framework which aims to abstract the ncurses library. I was wondering how understandable it is, and what I can improve! Any feedback is welcome!! My ...
Labricecat's user avatar
11 votes
1 answer
3k views

C++14 Event System

I've created a simplified event system for C++14. The code is commented, so it shouldn't be hard to read. There's also a simple usage scenario below. It is still a work in progress and uses some not-...
Crossfire's user avatar
  • 211
10 votes
5 answers
19k views

One-shot events in C#

I have a class that performs some long-running operation. This class exposes a Completed event. I'd like clients that use this class to register to get notified ONLY ONCE when the class completes ...
lysergic-acid's user avatar
10 votes
2 answers
168 views

TestExplorerWindow, the event-tossing UI

Following up on Integrating Unit Testing functionality into an old COM-based IDE, I made quite a few changes to the UI, and now the code-behind for my ...
Mathieu Guindon's user avatar
10 votes
1 answer
698 views

Finger painting code

I have a very simple view that handles touch events and draws accordingly. It's nothing significant, but it does use a bit more CPU than I would like (35%). Again, it is the bare minimum (<90 lines)...
Josue Espinosa's user avatar
10 votes
2 answers
632 views

In memory data access for CSV files that may have changed

I'm reading data from CSV files and store the result in a simple DataContext instance that gets injected throughout my application. ...
Johan's user avatar
  • 631
10 votes
1 answer
442 views

Resizable containers with VueJS

A month ago I reviewed the code in Resizable split DIVs Vue.js, suggesting that the OP use computed properties and bound styles to simplify the code (at least reducing the need to use ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
9 votes
4 answers
2k views

Making an Action<T> event also usable as Action<object> and Action in C#

Edit I've added a second pass at this problem based on the answers that have been posted by other users so far: https://codereview.stackexchange.com/a/221525/75659 Context Before presenting the ...
Johannes's user avatar
  • 277
9 votes
2 answers
709 views

Animated Calendar using HTML + CSS + JS

I'm a beginner developer and I'm building a calendar for smartphones. I'm using HTML, CSS and JS. I'm not entirely done with the project yet, however, I have the feeling that I'm making a messy code. ...
LUCAS DE BIAZI FERREIRA's user avatar
9 votes
2 answers
4k views

WinForm Calculator

I'm looking to get this cleaned up. ...
MrMoose's user avatar
  • 91
9 votes
2 answers
516 views

Flex panels in CSS and JS

I was following Wes Bos JS 30-day challenge, so HTML and CSS are mostly are copy-paste, I'd like feedback on JS (mostly). Thanks. ...
user3132457's user avatar
9 votes
2 answers
8k views

Yet another event dispatcher in c++11

I've written an event dispatcher for a private project which task is to collect events from different threads and dispatch them in a single thread: ...
nikolas's user avatar
  • 93
9 votes
3 answers
7k views

Event loop in C++

Writing an EventLoop in C++. Few requirements, from a user perspective: Must be simple to use (as simple as the Javascript event loop) No type casting, no complex registering of event handler. Plain ...
Luke Skywalker's user avatar
9 votes
2 answers
5k views

"Block a website" script with vanilla JavaScript

I use this script to block access to a one or more websites with vanilla JavaScript. I find that it helps me avoid some addictive news websites that make me depressed. (Credit to Marat Tanalin for ...
user avatar
9 votes
3 answers
791 views

Carousel in Vanilla JavaScript

I finally got my carousel to work in JavaScript, and I want to know what you guys think about it and what I can do better. ...
Jordan Baron's user avatar
9 votes
1 answer
29k 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 ...
Daan's user avatar
  • 191
9 votes
2 answers
572 views

Dynamic network messaging

I'm building a client and server for a game but wanted a generic messaging system in a shared library that let me focus on application logic and was largely separate form the underlying networking I/O ...
Cameron Owen's user avatar
9 votes
2 answers
129 views

User-focused timeline logging

I'm working on a small piece of my personal website. I'd like a timeline logging all of my relevant achievements in my career in Computer Science, in general. I'd like to implement a feature that ...
Duke Jake Morgan's user avatar
9 votes
1 answer
3k views

Implementing my own signal slot mechanism using C++11

I programmed in C# and I used the Qt framework. Both of them have their own signal slot mechanism which are really powerful. I looked at several implementations in C++ and based on what I learnt from ...
Szőke Szabolcs's user avatar
9 votes
2 answers
3k views

Recorder for keyboard and mouse events

I'm building an event recorder. So far the code looks clean, but I feel like I'm missing something that can make this code even better. Is composition a better solution? If yes, how can I do it ...
jdsninja's user avatar
  • 177
8 votes
3 answers
811 views

Fourteen buttons with hover effects

I have just started learning coding and am trying to clean up a website that I am making. Everything is functional, but I imagine there is a better way write everything that is there, because a good ...
Nicholas Chauvin nxchauvin's user avatar
8 votes
2 answers
891 views

Event functionality in C

I am beginner to intermediate and wanted to write a little event code in c. It's one header file with 108 line pure code and it does what I was thinking it should be like for me. EventListener.h ...
mortytheshorty's user avatar
8 votes
1 answer
2k views

How can I condense several IBAction methods in a class with a delegate?

I have the following class: MyProtocolClass.h ...
nhgrif's user avatar
  • 25.3k
8 votes
3 answers
2k views

Mask latitude text field

I have an input element on one of the pages. This input is supposed to take a string of digits from a user. In order to enhance UX I'd like to mask input's value at any given time. Like so: What came ...
askhat's user avatar
  • 123
8 votes
1 answer
4k views

"Function Buffer" to avoid triggering an event handler too frequently

If some big event handler is triggered too frequently, it will cause computer lagging. In my example $(window).resize(), I want the function to be called after the ...
MyNameIsAlvin's user avatar
8 votes
1 answer
3k views

ECS Event/Messaging implementation

I am experimenting with ECS design and I am looking for a solid way to implement a message bus for use between the different systems. Here is a stripped-down version of my current implementation: <...
Veritas's user avatar
  • 245
8 votes
2 answers
956 views

Drag and drop single files on different targets for different purposes

I have three text fields (DevExpress ButtonEdits set to read only) on a Windows Forms app. They look like this: They're used by dragging and dropping a single ...
kdbanman's user avatar
  • 181
8 votes
2 answers
3k views

Overriding all Access form control AfterUpdate methods

I have a set of custom event handlers for all my textboxes and combo boxes. The reason for this is my users want the bound form (to SQL Server) to immediately push changes to the recordset, rather ...
enderland's user avatar
  • 1,726
8 votes
2 answers
343 views

Vanilla Javascript: Chained AJAX request

I'd be grateful for a review of my AJAX request. If I have taken the correct approach here and especially any security concerns! I am creating a Purchase Order system for my manager (as part of an ...
gclark18's user avatar
  • 201
8 votes
2 answers
2k views

Javascript typehead using debounce

This is the code I wrote for making a JavaScript typeahead/autocomplete, which displays cities based on the user input. It would be great if you could suggest some improvements on the code quality. ...
Rahul Arora's user avatar
8 votes
1 answer
2k views

Animations when navigation items are clicked

I'm a beginner in jQuery and am wondering how I could write the following code shorter, since I'm repeating a lot. Working example ...
Julia's user avatar
  • 83
8 votes
1 answer
2k views

C++ Event System - Game Engine

Introduction I have just started learning templates and experimenting with function pointers. I wanted to create an event system that met a couple of goals: Event types are PODs, and do not inherit ...
kainev's user avatar
  • 301
8 votes
1 answer
442 views

Simple color clicker game

My friend recently made a color clicker game, and I tried cleaning up the code a bit. I want to know how I can improve the functions and passing/editing of global variables. There are a lot of ...
Gab De Jesus's user avatar
8 votes
1 answer
402 views

Cat Clicker MVC

I'm training my coding and wish you guys to see how my code is. I made a cat clicker based on the MVC pattern. Basically it shows a list of cats and when you click a cat name it shows an image, and ...
Mônica R.'s user avatar
8 votes
0 answers
564 views

Simple, intuitive and (hopefully) safe EventDispatcher

For my own game engine I need an event system. I tried to avoid the single-huge-enum-approach for minimizing compile times. The BasicEventListener is the (...
Tim Diekmann's user avatar
7 votes
2 answers
3k views

Updating dimensions when focus is lost from any of 9 columns

How can I write this more pretty? ...
dadde's user avatar
  • 181
7 votes
3 answers
3k views

EventBus in C++

Edit I do know the example key event doesn't carry any data (like keycode) but that isn't really the point of the review - the overall setup is :) Original After reading quite few suggestions on this ...
Jiri Kralovec's user avatar

1
2 3 4 5
10