Click here to Skip to main content
15,867,924 members
Please Sign up or sign in to vote.
3.66/5 (55 votes)
See more:

Disclaimer!



This Question is asked just for fun.

Few CodeProject members expressed their interest in my idea of the competition
"Most Elegant and Comprehensive Solution of a Completely Useless Task".

I've chosen the title "Completely Useless Challenge". I promised to come up with the idea of some interesting problems. Here is my first one.

I would like anyone to avoid votes based on practical considerations (and perhaps any down-voting). The purpose of the Challenge is to show off some programming muscles and have fun. It the same time, I would not be surprised that the Answers will show useful techniques in terms of robustness, programming styles, readability, elegance and supportability of code. This and only this should be useful, not the application of the technique.

The answer can be published as CodeProject articles and referenced in the Answer. Just ideas or simple codes can be posted as Answers.

Mouse-hating UI library


Here is the problem. We need a universal UI library aimed to punish users trying to control UI with the mouse. Indeed, who needs mouse? Everyone knows that mouse operations are much slower than keyboard operations (when the UI is really keyboard-friendly). In contrast, using only keyboard boost effectiveness, develop user's memory and improve the user's self-esteem and SOI (Sense of Own Importance). To promote good user's behavior and skills, existing UI applications need an advanced feature which punishes the user for using mouse. :-)

The primary target for the library should be .NET System.Windows.Forms and WPF. Other libraries are welcome. The library should be absolutely universal. For this purpose, it is required that a new behavior is applied in just one call (for example, with the parameter of Application or main Form). It is not required to work with any application: the library can be added to the target project and its main method is called (presumably, from application entry point).

Expected Behavior


Every time the user clicks any location in the application's form, window, control or framework UI element, she or he should be punished by making a hole in the window at the location of click. It should be a true hole: clicking in the hole should trigger events in the window of the application underneath, not the application using the library. The application run-time should calculate the score of user's mistake: from time to time the size of the new holes grows depending on the score (number of unwanted uses of the mouse). See for additional challenging requirements below. It's nice to accompany the punishment acts with different sounds, depending on the score and perhaps other factors (click in control of window, depending on the level of clicked controls, etc.). The clicks on a control should be completely disabled, so no "useful" effect of mouse click is allowed.

Challenge #1:


The behavior described above should be applied for clicks in non-client areas as well.


Challenge #2:


The behavior described above should be limited to "useful" mouse clicks only, that is, if without the mouse-hating feature nothing happens to the UI, such click is not punished. I think this requirement is hard to implement.


Challenge #3:


The holes can be decorated. The hole can get irregular shape with burned edges of irregular shapes. The burned edge should be a part of a window/form, but the hole itself should not.


Technical Notes:


The implementation of holes with System.Windows.Forms is easy: it is defined by the Region property. For WPF, it can be done using combination of WindowStyle="None" AllowsTransparency="True" and setting of the property Clip to some custom Geometry. Unfortunately, this method does not allow showing non-client area of the window.


—SA
Posted
Updated 5-Jun-14 18:23pm
v18
Comments
Espen Harlinn 13-Mar-11 16:23pm    
Sounds like a bit of fun :)
Angela 10293848 4-Jan-14 7:27am    
oh my computer!!!!!!!!!!!:))))))))))))))
Sergey Alexandrovich Kryukov 13-Mar-11 16:58pm    
Thank you.
I have 2-3 other ideas, but want to see what happens to this one.
I wish I could invent something which is easier.
--SA
Member 8043849 3-Jul-11 20:07pm    
its a long term and deep project ..... but possible.
now college time so in next vaccation......
Member 8043849 3-Jul-11 20:07pm    
its a long term and deep project ..... but possible.
now college time so in next vaccation......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900