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
0 votes
0 answers
24 views

Messaging correlation and syncing

We use masstransit and sagas. But I also wanted to correlate some messages without the need for a saga since the syntax for those are pretty verbose if all your need is to sync on a correlation id. ...
Anders's user avatar
  • 670
1 vote
1 answer
62 views

Event manager based on decorators

This module is a simple event manager that works with decorators. I would like feedback on: Bugs Any ideas to get rid of the classevent decorator, which ...
rdesparbes's user avatar
1 vote
1 answer
85 views

A Windows localhost key logger in C++ with WinAPI

Now I have this repository. It's a key logger logging all the keyboard events possible. Note that some programs do not "leak" the keyboard events outside of their GUI. For example, Notepad++ ...
coderodde's user avatar
  • 28.2k
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
1 vote
0 answers
41 views

A JavaFX program to find out the mouse refresh rate v3

(This post is the continuation of A JavaFX program to find out the mouse refresh rate v2.) After taking @J_H's suggestions into account, I ended up here: ...
coderodde's user avatar
  • 28.2k
3 votes
1 answer
60 views

A JavaFX program to find out the mouse refresh rate v2

(See the continuation of this post in A JavaFX program to find out the mouse refresh rate v3.) (This post is a continuation of A JavaFX program to find out the mouse refresh rate.) After adopting the ...
coderodde's user avatar
  • 28.2k
2 votes
1 answer
80 views

A JavaFX program to find out the mouse refresh rate

(See the next version here.) Intro I have this tiny JavaFX program that shows a 800x600 pixel canvas. You are supposed to drag the mouse within the canvas. When you are done dragging, the program will ...
coderodde's user avatar
  • 28.2k
0 votes
0 answers
151 views

Debouncing events and stale closures in functional React

Context As part of our React application, in which we use functional components, we encountered a scenario where we needed to debounce parts of a DOM event listener for usability purposes. The actual ...
M0nst3R's user avatar
  • 213
4 votes
1 answer
218 views

Improved Event System & InputManager Using C++

I am new to C++, so please take me easy. I want to make a low-level game engine only using C++, OpenGL and GLFW. This is a continuation of Event System using C++ ; I added the suggestions from there. ...
Andrei Rost's user avatar
1 vote
0 answers
52 views

Event System in C++ [duplicate]

I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
Andrei Rost's user avatar
3 votes
2 answers
2k views

Event System using C++

I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
Andrei Rost's user avatar
4 votes
2 answers
261 views

Detecting when a user stops typing

I wanted to detect when a user stops typing. I encountered this answer from SO (Not the selected answer, but the second one which seem to be better): https://stackoverflow.com/a/5926782/17746636 But I ...
pileup's user avatar
  • 421
6 votes
1 answer
555 views

Event manager for games written in C++17

This is a single header event manager that I'm using in my game. Disclaimer I ripped everything from these lovely people: https://austinmorlan.com/posts/entity_component_system/ C++ Event System - ...
Burning Flemingo's user avatar
6 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 vote
0 answers
22 views

Event system in react

What I Want? I want to make an event system in React that cuts back on unnecessary re-renders and stops props drilling. What I Did? The code I came up with is the following: ...
workoverflow's user avatar
3 votes
3 answers
137 views

Follow up: A chat server using the select() API

This is a follow up to my last question: Multiperson chat server using the select() API Changes: After much fine critique, I made the following changes to the code: Removed redundant casts and ...
Harith's user avatar
  • 5,834
8 votes
2 answers
859 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
0 votes
1 answer
65 views

Delayed, concurrent event stack in Java - follow-up

I have slightly refactored the Delayed, concurrent event stack in Java. Now it looks like this: DelayedEventStack.java ...
coderodde's user avatar
  • 28.2k
0 votes
3 answers
196 views

Delayed, concurrent event stack in Java

(See the next iteration: Delayed, concurrent event stack in Java - follow-up ) Motivation I was confronted with a task of having "message events" for a GUI program. The use case is as ...
coderodde's user avatar
  • 28.2k
3 votes
1 answer
1k views

Count how many times left mouse button is clicked

The code snippet works perfectly fine, but someone said, and I quote, "this is some of the weirdest code i've seen", so I'd just like any advice for it. It's supposed to count the amount of ...
shge's user avatar
  • 33
1 vote
1 answer
40 views

Moveable Points - Update variable without Re-referencing variable? Event Subscriptions? (C#, Unity)

So I have this helper script that I use to move points around manually while debugging: ...
FaffyWaffles's user avatar
2 votes
0 answers
71 views

To-do list application

I use a lot of for loops and I think it slows the code down a lot but I have no idea how else this code could be written. Its for a to-do list app and each ...
Helan's user avatar
  • 21
0 votes
1 answer
64 views

JS "Tabs" element

How can this be improved? I'm looking particularly at the twice repeated tabButtons.forEach(button => { ...
Matt's user avatar
  • 1
4 votes
1 answer
469 views

Setting all hidden fields based on id

I am working on a web page where there is a checkbox with a value and a hidden field. I want to ask your opinion on whether this logic is sound. My logic The checkbox has a value that matches the id ...
Jefferson's user avatar
  • 361
2 votes
1 answer
884 views

Animating GIF on hover in Javascript

I don't know JavaScript and it's safe to say this is my first code ever written in JS. I just needed to animate my GIFs when user hovers over them only. Googling separate concepts such as "string ...
Edenia's user avatar
  • 1,568
1 vote
1 answer
60 views

Event handler for client webrtc video chat

This is my event handler for a videochat client that takes all the events that the server throws at us and routes them to different functions. All of the functions are imported and both settings and ...
PWall's user avatar
  • 11
0 votes
1 answer
149 views

Range slider show/hides and reset (vanilla js)

I have a HTML5 range slider. i.e. ...
Lieutenant Dan's user avatar
1 vote
1 answer
456 views

Basic Event manager implementation

I have written a very simple algorithm vizualizer where all input is coming from the mouse and I needed an event manager for that. Since I never wrote one before, I wrote a 30 min implementation to ...
a a's user avatar
  • 157
1 vote
1 answer
186 views

A C WinAPI program for showing the color of the screen pixel pointed to by mouse cursor with clipboard support - follow up

(See the previous question.) Now I have incorporated some suggestions by Barmak Shemirani. See what I have: ...
coderodde's user avatar
  • 28.2k
4 votes
2 answers
274 views

A C WinAPI program for showing the color of the screen pixel pointed to by mouse cursor with clipboard support

(See the follow-up question.) I have this program that shows a small window and that window shows a rectangle whose color is the same as the color of the pixel under the mouse cursor. Note that it ...
coderodde's user avatar
  • 28.2k
0 votes
1 answer
276 views

Updating active cards dynamically added by API

I am making a website where you can search through all the countries in the world. Once you have found a country you want more detail about you should be able to click and view a detailed page with ...
Bram Mortier's user avatar
2 votes
2 answers
288 views

Event Dispatcher for GLFW/Glad

I've tried to write an event dispatcher for a GLFW/Glad library. However I am not very used to writing efficient code (spent the majority of my life writing in C# and performance was never really the ...
ScrappyHaxor's user avatar
3 votes
1 answer
347 views

Javascript array from IP address

I want to make this code better. It works now but I think it can be better. I have a working sample on jsfiddle. When the page loads I have the End IP Address disable until the data is entered. Then I ...
Jefferson's user avatar
3 votes
2 answers
953 views

Event Dispatching System

Below you can see my implementation of a simple event dispatcher. I would like to get some feedback or improvement tips regarding the design and maybe an idea how to get rid of the static_cast. Thank ...
Manu's user avatar
  • 133
2 votes
1 answer
1k views

Generic Event class

C++ Event class From the desire of having a callback function which includes a void* userdata argument, I've made this generic event class. It is tested and working, but some desired features are ...
Shigoto Shoujin's user avatar
1 vote
2 answers
160 views

Javascript - On mouseup check if any of the parents has/includes specific id

On my page I have a mouseup eventlistener on document. I want to be able catch if the clicked elements has a specific ...
Rubioli's user avatar
  • 113
1 vote
1 answer
160 views

list of games to open radar match in iframe on for drop-down controls

In general my page is slow and has several points in the code that I believe can be improved, even in relation to the structure used. Anyway, the biggest problem is: The page I'm creating is very ...
Digital Farmer's user avatar
3 votes
2 answers
103 views

Javascript (ES11) Event System implementation

So I decided to implement a basic event system in JavaScript. My goal was to support the following functions: on - allows the user to register a handler on the ...
Hex's user avatar
  • 435
3 votes
0 answers
268 views

A Compile-time templated event system and dispatch manager

Problem I would like to make an efficient, extensible, and potentially asynchronous parallelizable event system using modern features in C++20. My solution I've constructed a templated event struct by ...
Robbie's user avatar
  • 131
0 votes
2 answers
164 views

is this a good way of using events?

So I'm currently trying to learn more about events using C# and the example that I just write seems a bit.. It seems a bit too much? I feel like you could accomplish the same thing with way less code. ...
John V Dole's user avatar
3 votes
2 answers
86 views

Limit second <select> options based on the first <select>

I want to see if there's a better way to write this code, solely in Javascript. There are two kinds of sets, the first set (C7, T7, C11, T11) have four options in the first select, and then up to two ...
Liv Strawbridge's user avatar
2 votes
1 answer
319 views

To-do app front-end in Vue 3

I have put together a To-do Application with the Slim framework on the back-end (API) and a Vue 3 front-end. I added a demo on my YouTube channel. In the main App.vue file I have: ...
Razvan Zamfir's user avatar
4 votes
2 answers
971 views

Vue.js checkout stepper

I have made this small checkout stepper with Vue (v 2.x.x): ...
Razvan Zamfir's user avatar
1 vote
1 answer
308 views

dispatch event listener problem after click

My code is working fine... but I want to remove below those(1) lines of code from my example code(2) (JS Code). If I remove those code then a tag is not working. (a tag do not open link or href is not ...
نور's user avatar
  • 63
2 votes
1 answer
330 views

JavaScript copy-to-clipboard class

I am have made a small copy-to-clipboard script. I have made a method called copyToClipboard that does the following: create an input box; read the content of an ...
Razvan Zamfir's user avatar
4 votes
1 answer
92 views

Javascript Pub/Sub

Here is a short pice of code that suppose to work as Pub/Sub or EventDisptacher of some sort. I only do code in JS a few times a year, so hence I'm asking for your time. Right now I'm working on ...
Aksis's user avatar
  • 43
5 votes
1 answer
7k views

C++ event loop and thread signaling

Use case This is an event loop and signaling system I created for a piece of software which will have multiple asynchronous server/clients/event-emitters/ui, some of those components will have their ...
fededevi's user avatar
  • 310
3 votes
2 answers
9k views

C++: Event system for game engine

Since writing your own C++ game engine seems to be really popular these days (seriously just look at the amount of people presenting their WIPs on YouTube) I figured I'd try it myself. My mental model ...
TheBeautifulOrc's user avatar
2 votes
1 answer
212 views

Carousel Using Vanilla Javascript

As a beginner project, I've start working on this carousel slider that would slide through an image and a testimonial on click. The number of images and content slides would always be the same number. ...
Leandro's user avatar
  • 23
3 votes
1 answer
165 views

Submitting form jQuery checkboxlist

In my requestForm submit function I have this logic that checks three checkboxes and then displays the label with an error message. Is there better logic? I would be happy for any kind of feedback ...
Jefferson's user avatar
  • 123

1
2 3 4 5
10