Mouse input lag
My USB mouse and also other USB input devices like my wacom graphics tablet suffer from consistently reoccuring lags, during which they are unresponsive for about half a second.
Somebody an idea, what could cause that?
In my case laptop-mode was configured to enable the autosuspend, so the udev rule wasn't fixing the problem.
I added
AUTOSUSPEND_USBTYPE_BLACKLIST="usbhid"
to
/etc/laptop-mode/conf.d/usb-autosuspend.conf
and now my USB mouse doesn't power save when I unplug the AC adapter.
HTH,
-duck
Similar Messages
-
Dragging input lag in Air 2.6 iOS
I'm creating a drag and drop application using Air 2.6 and compiling for iOS and testing on an iPad 1.
I see quite a bit of input lag when I drag something around and my finger moves too fast, the item trails what seem to be several frames behind where my finger is.
The structure of my code is something like this:
public class Dragger
dragging:Boolean = false;
public function Dragger()
surface.addEventListener(Event.ENTER_FRAME, handleEnterFrame);
private function handleEnterFrame(e:Event):void
if (dragging)
selectedItem.x = surface.mouseX;
selectedItem.y = surface.mouseY;
I've also tried listening for MOUSE_MOVE events with the same (rather large) level of lag. I've used native applications that have better responsiveness than I have achieved. Has anyone figured out how to get less lag when dragging?You should use touch events, not mouse events.
...well in your case your not useing any events for it, but still you don't really want to look for mouse data.
here are some tuts on it
http://gotoandlearn.com/play.php?id=122
http://gotoandlearn.com/play.php?id=119
i have no time to show, but can search for as3 touch events example, you will get much smoother dragging -
Crazy input lag in digital painting software
Hi,
at work I have a MacBook Air 13" Mid-2012 (CPU i5 1.8 GHz, SSD 128 GB, RAM 8 GB, OS X 10.8.5) connected to an external monitor (DELL ultrasharp). I tried to use this computer with some digital painting software (like Adobe Photoshop, Corel Painter and GIMP) via Wacom Intuos 4, but I have always the same problem: heavy input lag, I am not comfortable to paint anything with this lag. This problem occurs with mouse too (if I try to paint a long line with mouse the lag is still there); I do not have this problem under Windows 8 on another computer with my Wacom Intuos 4 (this means the problem is related to MacBook Air and/or Mountain Lion). Should I switch back to my old workstation with Windows?
Thx for any help
Paolo
P.S.
All drivers and software are updated, I tried SmoothMouse and similar software but the problem is still there.Hi Kelmen,
"clicking mouse or keyboard will causing obvious lagging/short-hanging in game, like 1-2 seconds. if i move mouse it is ok. this will keep occuring for like 15-30 secs, after that, issue will gone."
According to my own experience ,it is a normal symptom .
During the booting process of the games ,there are many system resources occupied by the games.So it is reasonable ,we will come across a little lag issue.We can open the task manager to monitor the staus of the system resources .
To get a better performance of palying games ,we can try to disable the unnecessary autorun program to allocate the system resources for the game .
We can use the Autorun tool to achieve.
Autoruns for Windows v13.2
https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx?f=255&MSPPError=-2147217396
To get a better performance ,it is recommended to keep the machine up to date .
We can try to manually update the driver for the mouse ,keyboard ,video card .It is recommended to download the latest driver from the manufacturer website for these devices.
Best regards
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
Urxvt -depth 32 / Intel graphics = input lag
I have a very strange behavior with urxvt at color depth 32: when I press a key and wait for it to repeat and release it, then the last input lags for about one second. For example, moving in a terminal/vim, the cursor stops when I release the key, then moves one second later. Same thing with mouse scroll. If I set depth to its default value, it works just fine.
Does anyone have this annoying problem?
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
xorg-server : 1.9.2-2
xf86-video-intel : 2.13.0-4
rxvt-unicode : 9.09-1The i915 isn't a graphics powerhouse - what are you comparing with when you say its slow? Glxinfo says direct rendering is enabled and your Xorg log looks ok.
Try sudo gpasswd -a <username> video to add yourself to the group for /dev/dri/card0. Logout and back in and see if that helps. -
MBP + external monitor + USB mouse + iTunes = lag
Hello, I am wondering if any of you can offer a solution to my problem. When I use my mac with my external monitor and external mouse, there is a systemwide lag every 3 seconds - the display sort of pauses, briefly interrupting mouse input and video playback. When deleting a long line of text it is again apparent.
It is not the mouse, as I have tried 3 different mice with the up to date drivers and they all work fine while itunes is not open and when using the laptop's screen, which also eliminates the variable of a poor mouse surface (it is good regardless).
There is no skipping when using the laptop's screen, regardless of itunes being open or not. Also, there is no skipping at all when I boot into windows and use it with the external display.
The skipping also occurs when video is being played back via Quicktime, with iTunes closed. The same video played with VLC does not cause the issue.
I have the computer hooked up to a Samsung SyncMaster 2494HM LCD, via the apple mini DP to DVI adapter, and with a DVI-HDMI cable (this decreased the issue from when it was connected with DVI and skipped all the time).
I have tried a different user account, and the problem persists there too. I have reset my PRAM and NVRAM also.
This is quite strange; any suggestions?bump?
-
Last upgrade killed KDM keyboard/mouse input
Hi, I performed a pacman -Syu last night and a few packages were upgraded. Now, when I reach the KDM login, it does not detect keyboard or mouse input. However during the boot process it detected the keyboard properly. Of course, now I can't use ctrl-alt-f1 to reach a VC from the KDM screen.
The relevant snippet of pacman.log is below. I took a look and I tried downgrading a few packages from a livecd: xproto and xorg-xinit, but without success. I actually cleared my pacman cache a while ago because of a pacman error, so I don't have very many package backups unfortunately. Perhaps somebody can pinpoint the package that is giving me all this trouble?
Thanks!
[2010-12-20 02:05] synchronizing package lists
[2010-12-20 02:12] Running 'pacman -S -u'
[2010-12-20 02:12] starting full system upgrade
[2010-12-20 02:20] removed pycairo (1.8.10-2)
[2010-12-20 02:20] upgraded arandr (0.1.3-5 -> 0.1.4-1)
[2010-12-20 02:20] upgraded bash (4.1.009-1 -> 4.1.009-3)
[2010-12-20 02:20] upgraded bluez (4.80-1 -> 4.82-1)
[2010-12-20 02:20] upgraded run-parts (3.2.3-1 -> 3.4.1-1)
[2010-12-20 02:20] Clearing symlinks in /etc/ssl/certs...done.
[2010-12-20 02:20] Updating certificates in /etc/ssl/certs... 141 added, 0 removed; done.
[2010-12-20 02:20] Running hooks in /etc/ca-certificates/update.d....done.
[2010-12-20 02:20] upgraded ca-certificates (20090814-3 -> 20090814+nmu2-1)
[2010-12-20 02:20] upgraded cdrkit (1.1.10-1 -> 1.1.11-1)
[2010-12-20 02:20] upgraded chromium (8.0.552.215-1 -> 8.0.552.224-1)
[2010-12-20 02:20] upgraded device-mapper (2.02.77-1 -> 2.02.78-1)
[2010-12-20 02:20] upgraded dhcpcd (5.2.8-1 -> 5.2.9-1)
[2010-12-20 02:20] warning: /etc/profile installed as /etc/profile.pacnew
[2010-12-20 02:20] warning: /etc/hosts installed as /etc/hosts.pacnew
[2010-12-20 02:20] warning: /etc/gshadow installed as /etc/gshadow.pacnew
[2010-12-20 02:20] upgraded filesystem (2010.10-1 -> 2010.12-1)
[2010-12-20 02:20] upgraded libpulse (0.9.22-1 -> 0.9.22-2)
[2010-12-20 02:20] upgraded fluidsynth (1.1.3-1 -> 1.1.3-2)
[2010-12-20 02:20] upgraded foomatic-db (4.0.5_20101024-1 -> 4.0.6_20101215-1)
[2010-12-20 02:20] upgraded foomatic-filters (4.0.5_20101024-1 -> 4.0.6_20101215-1)
[2010-12-20 02:20] upgraded foomatic-db-engine (4.0.5_20101024-1 -> 4.0.6_20101215-1)
[2010-12-20 02:20] upgraded zlib (1.2.5-2 -> 1.2.5-3)
[2010-12-20 02:20] upgraded ghostscript (9.00-1 -> 9.00-2)
[2010-12-20 02:21] upgraded git (1.7.3.3-1 -> 1.7.3.4-1)
[2010-12-20 02:21] upgraded gnutls (2.8.6-1 -> 2.10.4-1)
[2010-12-20 02:21] upgraded gparted (0.7.0-1 -> 0.7.1-1)
[2010-12-20 02:21] upgraded gpsd (2.95-7 -> 2.95-8)
[2010-12-20 02:21] upgraded graphicsmagick (1.3.7-3 -> 1.3.12-1)
[2010-12-20 02:21] upgraded libdrm (2.4.22-1 -> 2.4.22-3)
[2010-12-20 02:21] upgraded libgl (7.9-1 -> 7.9.0.git20101207-2)
[2010-12-20 02:21] upgraded intel-dri (7.9-1 -> 7.9.0.git20101207-2)
[2010-12-20 02:21] upgraded opencv (2.2.0-1 -> 2.2.0-2)
[2010-12-20 02:21] upgraded kipi-plugins (1.6.0-1 -> 1.6.0-2)
[2010-12-20 02:21] upgraded libdbusmenu-qt (0.6.4-1 -> 0.6.6-1)
[2010-12-20 02:21] upgraded libdvdcss (1.2.10-1.1 -> 1.2.10-2)
[2010-12-20 02:21] upgraded libindi (0.7-1 -> 0.7.2-1)
[2010-12-20 02:21] upgraded libmpdclient (2.2-1 -> 2.3-1)
[2010-12-20 02:21] upgraded libogg (1.2.1-1 -> 1.2.2-1)
[2010-12-20 02:21] upgraded libpcap (1.1.1-1 -> 1.1.1-2)
[2010-12-20 02:21] upgraded lvm2 (2.02.77-1 -> 2.02.78-1)
[2010-12-20 02:21] upgraded mesa (7.9-1 -> 7.9.0.git20101207-2)
[2010-12-20 02:21] upgraded mpd (0.15.15-2 -> 0.16-2)
[2010-12-20 02:21] upgraded pkg-config (0.25-2 -> 0.25-3)
[2010-12-20 02:21] upgraded procps (3.2.8-2 -> 3.2.8-3)
[2010-12-20 02:21] installed python2-cairo (1.8.10-1)
[2010-12-20 02:21] upgraded pycups (1.9.51-2 -> 1.9.53-1)
[2010-12-20 02:21] upgraded pysmbc (1.0.9-1 -> 1.0.10-1)
[2010-12-20 02:21] upgraded python-beautifulsoup (3.0.8.1-1 -> 3.2.0-1)
[2010-12-20 02:21] upgraded raptor (1.4.21-1 -> 1.4.21-2)
[2010-12-20 02:21] upgraded rasqal (0.9.20-1 -> 0.9.21-1)
[2010-12-20 02:21] upgraded redland (1.0.12-2 -> 1.0.12-3)
[2010-12-20 02:21] upgraded sdparm (1.05-1 -> 1.06-1)
[2010-12-20 02:21] upgraded system-config-printer-common (1.2.5-3 -> 1.2.5-4)
[2010-12-20 02:21] upgraded telepathy-glib (0.12.5-1 -> 0.12.6-1)
[2010-12-20 02:21] upgraded unrar (4.0.2-1 -> 4.0.3-1)
[2010-12-20 02:21] upgraded vpnc (0.5.3-2 -> 0.5.3-3)
[2010-12-20 02:21] upgraded xorg-xauth (1.0.4-1 -> 1.0.5-1)
[2010-12-20 02:21] upgraded xorg-xbacklight (1.1.1-1 -> 1.1.2-1)
[2010-12-20 02:21] upgraded xorg-xinit (1.3.0-1 -> 1.3.0-2)
[2010-12-20 02:21] upgraded xproto (7.0.19-1 -> 7.0.20-1)Alright, disabled KDM and logged into virtual console and startx. Same issue when I get into X/KDE, keyboard and mouse input not detected. Any idea as to which package might be the culprit? Unfortunately I am away from home for a couple weeks and can't get to my backup clones...
-
(Flex SDK 4.6 TextArea bug) How to disable s:TextArea mouse input
I need a TextArea with no mouse input but when i set mouseChildren="false" and mouseEnabled="false" it receives mouse input anyway. I want that mouse clicks pass through TextArea.
I did a test using SDK 4.5 and it works as expected, but in SDK 4.6 nothing happens.
HELP! i need that working in SDK 4.6+.
Thank you.Same..
Start a new Mobile App, and try yourself please:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
applicationDPI="160">
<s:TextArea id="txt" skinClass="spark.skins.mobile.TextAreaSkin">
<s:creationComplete>
txt.setFocus(); // crashes
</s:creationComplete>
</s:TextArea>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
applicationDPI="160">
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
s|TextArea { skinClass:ClassReference("spark.skins.mobile.TextAreaSkin") }
</fx:Style>
<s:TextArea id="txt">
<s:creationComplete>
txt.setFocus(); // crashes
</s:creationComplete>
</s:TextArea>
</s:Application> -
Please Help (Mouse input and graphics for small game)
Hi everyone, I'm new to this forum, but it looked like a good place to get some help with a simple-ish game I've been working on. I sorta posted the beginnings of it on a forum dedicated to another cool game called Soldat.
So that I don't have to retype much about the game itself, the link to the discussion is here (please mind the non-dev talk in there):
http://www.soldatforums.com/topic.asp?topic_id=20916
and the start of the 'game' is here:
http://llsc.us/members/Solidarnosc/uploads/SolidarnoscNew.jar
Anyhow, I need some advice on fast graphics. My game is sorta 3D (sorta-3D = that enigmatic 3D look in a 3D environment with sprites and no perspective), but I managed to use some simple mathematics and the basic AWT drawing methods to replicate 3D. The problem is that this is rather slow.
I have started to have a look at different methods of drawing such as OpenGL using JOGL etc, but this is all rather daunting at the moment for someone somewhat self taught (OK, I have done a bit of Java at high school, but it didn't get as far as using such big words as Classpath, Package, let alone Buffer) and I seem to have a curse like Tubbers when it comes to semi-complicated tutorials. Ideally, it would be handy if there was a very simple example or a class that extended a Frame or something similar that had a modified graphics/drawing system with a 'perfect' buffering system (OK, maybe I'm dreaming).
The other thing that I need help with is mouse movement detection. Currently, I am using a simple system of reading the mouse position on the frame to determine movement, but ideally I need a system that allows the mouse to keep moving without the constraints of the cursor needing to be in the form and not moving at edges of screen, etc.
Help would be appreciated, but thanks for reading this anyway.Maybe I'm not making myself clear here (or maybe I
missed a sign that that said "open source only"). I
don't need a part of my program fixed by someone else
as such, but rather I was just wondering what the
easiest way to speed up AWT graphics is and how can I
read mouse motion (specific to neither the cursor nor
the application's frame) or even just set the
cursor's position relative to frame. Failing that,
can someone tell me how I should read mouse input in
a way similar to a standard First Person Shooter?Unless I am missunderstanding what you want again, then take a look at AWT's Toolkit, it has
public void addAWTEventListener(AWTEventListener listener,
long eventMask)and it should do what you want. -
Has anybody had a problem with the mouse cursor lagging when navigating the drop down menus? this only started happening after a re-install. it only occurs in Photoshop elements 13 in the photo editing section,and no other application. My mouse drivers are up to date.Any help or advice would be most welcome.
Good day!
Please post Photoshop Elements related queries over at
http://forums.adobe.com/community/photoshop_elements
and please read this (in particular the section titled "Supply pertinent information for quicker answers"):
http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
Regards,
Pfaffenbichler -
I need to get Keyboard input as well as mouse input on a JButton
I need to get Keyboard input as well as mouse input on a JButton
I have attempted to implement KeyListener. I get the keyCode but I need it to go in to the same String variable as my Actionlistener section.Here is the code I have trouble with getting keyboard input as wells as mouse input into the same variable.
public class Calctester extends JFrame
implements ActionListener, KeyListener
private double var1, var2;//var1 and var2 are used to perform calculation
String operand1 = "";//takes first input until an operator is pressed
String operand2 = "";//takes input after operator is invoked
double result;//is used to store the result
boolean flag = false;//to signal operator pressed
boolean decimalFlag = false;//to signal decimal pressed
String stringInput;//used as a temporary store for all entry to allow for conditions to be evaluated
char ch; //used to store the operator for comparison//Reason is pre does not compare using string
String pre = "";//used to store the operator
double mem; //will hold memory operation values
double vMod; //Temporary store for var2 to be used with percent operations
//Creates buttons
JButton btn0 = new JButton("0");
JButton btn1 = new JButton("1");
JButton btn2 = new JButton("2");
JButton btn3 = new JButton("3");
JButton btn4 = new JButton("4");
JButton btn5 = new JButton("5");
JButton btn6 = new JButton("6");
JButton btn7 = new JButton("7");
JButton btn8 = new JButton("8");
JButton btn9 = new JButton("9");
JButton btnC = new JButton("C");
JButton btnCE = new JButton("CE");
JButton btnBkpSpc = new JButton("Backspace");
JButton btnPlus = new JButton("+");
JButton btnMinus = new JButton("-");
JButton btnMultiply = new JButton("*");
JButton btnDivide = new JButton("/");
JButton btnEquals = new JButton("=");
JButton btnPeriod = new JButton(".");
JButton btnPlusMinus = new JButton("+/-");
JButton btnSqrt = new JButton("sqrt");
JButton btnMod = new JButton("%");
JButton btnOneOverX = new JButton("1/x");
JButton btnMC = new JButton("MC");
JButton btnMR = new JButton("MR");
JButton btnMS = new JButton("MS");
JButton btnMPlus = new JButton("M+");
//Displays Text area for Display
JTextField txtArea = new JTextField("0.");//The calculation display area set to 0.
JTextField mArea = new JTextField();//to display memory operations
//Default constructor
Calctester()
//Defines a content pane
Container c = getContentPane();
//Defines the layout of the frame and sets it to null to allow absolute positioning
c.setLayout(null);
//Defines event handling
btn0.addActionListener(this);
btn1.addActionListener(this);
btn2.addActionListener(this);
btn3.addActionListener(this);
btn4.addActionListener(this);
btn5.addActionListener(this);
btn6.addActionListener(this);
btn7.addActionListener(this);
btn8.addActionListener(this);
btn9.addActionListener(this);
btnC.addActionListener(this);
btnCE.addActionListener(this);
btnBkpSpc.addActionListener(this);
btnPlus.addActionListener(this);
btnMinus.addActionListener(this);
btnDivide.addActionListener(this);
btnMultiply.addActionListener(this);
btnEquals.addActionListener(this);
btnPeriod.addActionListener(this);
btnPlusMinus.addActionListener(this);
btnSqrt.addActionListener(this);
btnMod.addActionListener(this);
btnOneOverX.addActionListener(this);
btnMR.addActionListener(this);
btnMS.addActionListener(this);
btnMPlus.addActionListener(this);
btnMC.addActionListener(this);
btn1.addKeyListener(this);
//Adds the buttons to the frame and sets the font of the label to be
//logical font Dialog,plain as opposed to Bold and the label size to 12
//Also sets the border type of aech button
c.add(btn0).setFont(new Font("Dialog", Font.PLAIN, 12));
btn0.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn1).setFont(new Font("Dialog", Font.PLAIN, 12));
btn1.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn2).setFont(new Font("Dialog", Font.PLAIN, 12));
btn2.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn3).setFont(new Font("Dialog", Font.PLAIN, 12));
btn3.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn4).setFont(new Font("Dialog", Font.PLAIN, 12));
btn4.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn5).setFont(new Font("Dialog", Font.PLAIN, 12));
btn5.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn6).setFont(new Font("Dialog", Font.PLAIN, 12));
btn6.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn7).setFont(new Font("Dialog", Font.PLAIN, 12));
btn7.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn8).setFont(new Font("Dialog", Font.PLAIN, 12));
btn8.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btn9).setFont(new Font("Dialog", Font.PLAIN, 12));
btn9.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnC).setFont(new Font("Dialog", Font.PLAIN, 12));
btnC.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnCE).setFont(new Font("Helvetica", Font.PLAIN, 12));
btnCE.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnBkpSpc).setFont(new Font("Dialog", Font.PLAIN, 12));
btnBkpSpc.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnPlus).setFont(new Font("Dialog", Font.PLAIN, 12));
btnPlus.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMinus).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMinus.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMultiply).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMultiply.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnDivide).setFont(new Font("Dialog", Font.PLAIN, 12));
btnDivide.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnEquals).setFont(new Font("Dialog", Font.PLAIN, 12));
btnEquals.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnPeriod).setFont(new Font("Dialog", Font.PLAIN, 12));
btnPeriod.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnPlusMinus).setFont(new Font("Dialog", Font.PLAIN, 12));
btnPlusMinus.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMod).setFont(new Font("Albertus Medium", Font.PLAIN, 12));
btnMod.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnSqrt).setFont(new Font("Microsoft San Serif", Font.PLAIN, 11));
btnSqrt.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnOneOverX).setFont(new Font("Dialog", Font.PLAIN, 12));
btnOneOverX.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMC).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMC.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMS).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMS.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMR).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMR.setBorder(new BevelBorder(BevelBorder.RAISED));
c.add(btnMPlus).setFont(new Font("Dialog", Font.PLAIN, 12));
btnMPlus.setBorder(new BevelBorder(BevelBorder.RAISED));
//sets the color of the label of the buttons
btnC.setForeground(Color.red);
btnCE.setForeground(Color.red);
btnBkpSpc.setForeground(Color.red);
btnDivide.setForeground(Color.red);
btnMultiply.setForeground(Color.red);
btnMinus.setForeground(Color.red);
btnPlus.setForeground(Color.red);
btnMC.setForeground(Color.red);
btnMR.setForeground(Color.red);
btnMS.setForeground(Color.red);
btnMPlus.setForeground(Color.red);
btnEquals.setForeground(Color.red);
btn0.setForeground(Color.blue);
btn1.setForeground(Color.blue);
btn2.setForeground(Color.blue);
btn3.setForeground(Color.blue);
btn4.setForeground(Color.blue);
btn5.setForeground(Color.blue);
btn6.setForeground(Color.blue);
btn7.setForeground(Color.blue);
btn8.setForeground(Color.blue);
btn9.setForeground(Color.blue);
btnPlusMinus.setForeground(Color.blue);
btnSqrt.setForeground(Color.blue);
btnMod.setForeground(Color.blue);
btnOneOverX.setForeground(Color.blue);
btn0.setFocusPainted(false);
btnPlus.setFocusPainted(false);
btnEquals.setFocusPainted(false);
//The display text area and the memory operation text area
c.add(txtArea);
txtArea.setBorder(new BevelBorder(BevelBorder.LOWERED));
txtArea.setBounds(7,0,240,25);//To provide a Text box @ the top of the frame
txtArea.setEditable(false);
txtArea.setBackground(Color.white);
c.add(mArea);
mArea.setBounds(13, 35, 28, 25);
mArea.setEditable(false);
mArea.setBorder(new BevelBorder(BevelBorder.LOWERED));
setSize(260,251);//size of the frame
setTitle("Calculator"); //Title
setVisible(true); //this makes the frame visible on the screen
setResizable(false); //this disallow resizing of the frame
setDefaultCloseOperation(EXIT_ON_CLOSE);//to close app
//instead of the above method you can use the WindowsListener which extennds other classes and implements other interfaces.
setLocation(300,200);//positioning of the window on the screen
txtArea.setHorizontalAlignment(JTextField.RIGHT);//sets the text in the text field to the right
mArea.setHorizontalAlignment(JTextField.CENTER);//centers the label
JMenu editMenu = new JMenu("Edit");//creates menu
JMenuItem copy = new JMenuItem("Copy Ctrl+C");//creates menu item
copy.addActionListener(this);//event handling
JMenuItem paste = new JMenuItem("Paste Ctrl+V");//creates menu
paste.addActionListener(this);//event handling
JMenuBar myMenu = new JMenuBar();//declares a menu bar
setJMenuBar(myMenu);//adds the menu bar to the frame
editMenu.setBorderPainted(false);//removes the border shadow around the menu bar
myMenu.setBorderPainted(false);//removes the border shadow around menu bar
//adds menu items to the menu, sets the font and font size.
editMenu.add(paste).setFont(new Font("Dialog", Font.PLAIN, 12));//
editMenu.add(copy).setFont(new Font("Dialog", Font.PLAIN, 12));
myMenu.add(editMenu).setFont(new Font("Dialog", Font.PLAIN, 12));
JMenu viewMenu = new JMenu("View");//creates menu
JMenuItem sci = new JMenuItem("Scientific");//creates menu item
sci.addActionListener(this);//event handling
JMenuItem std = new JMenuItem("Standard");//creates menu item
//adds menu items to the menu, sets the font and font size.
viewMenu.add(sci).setFont(new Font("Dialog", Font.PLAIN, 12));
viewMenu.add(std).setFont(new Font("Dialog", Font.PLAIN, 12));
myMenu.add(viewMenu).setFont(new Font("Dialog", Font.PLAIN, 12));
JMenu helpMenu = new JMenu("Help");//creates menu
JMenuItem helpTopics = new JMenuItem("Help Topics");//creates menu item
JMenuItem aboutCalc = new JMenuItem("About Calculator");//creates menu item
helpTopics.addActionListener(this);//event handling
//helpTopics.setBorder(new BevelBorder(BevelBorder.RAISED));
helpTopics.setBorder(LineBorder.createGrayLineBorder());
//adds menu items to the menu, sets the font and font size.
helpMenu.add(helpTopics).setFont(new Font("Dialog", Font.PLAIN, 12));
helpMenu.add(aboutCalc).setFont(new Font("Dialog", Font.PLAIN, 12));
myMenu.add(helpMenu).setFont(new Font("Dialog", Font.PLAIN, 12));
//aboutCalc.setBorder(new BevelBorder(BevelBorder.RAISED));
aboutCalc.setBorder(LineBorder.createGrayLineBorder());
//aboutCalc.setActionCommand("Nothing here right now");
//Setting absolute positions for the buttons.
btn0.setBounds(50, 160, 35, 28);
btn1.setBounds(50, 130, 35, 28);
btn2.setBounds(90, 130, 35, 28);
btn3.setBounds(130, 130, 35, 28);
btn4.setBounds(50, 100, 35, 28);
btn5.setBounds(90, 100, 35, 28);
btn6.setBounds(130, 100, 35, 28);
btn7.setBounds(50, 70, 35, 28);
btn8.setBounds(90, 70, 35, 28);
btn9.setBounds(130, 70, 35, 28);
btnC.setBounds(180, 35, 63, 28);
btnCE.setBounds(115, 35, 63, 28);
btnBkpSpc.setBounds(50, 35, 63, 28);
btnPlus.setBounds(170, 160, 35, 28);
btnMinus.setBounds(170, 130, 35, 28);
btnMultiply.setBounds(170, 100, 35, 28);
btnDivide.setBounds(170, 70, 35, 28);
btnEquals.setBounds(210, 160, 35, 28);
btnPeriod.setBounds(130, 160, 35, 28);
btnPlusMinus.setBounds(90, 160, 35, 28);
btnMC.setBounds(8, 70, 35, 28);
btnMR.setBounds(8, 100, 35, 28);
btnMS.setBounds(8, 130, 35, 28);
btnMPlus.setBounds(8, 160, 35, 28);
btnSqrt.setBounds(210, 70, 35, 28);
btnMod.setBounds(210, 100, 35, 28);
btnOneOverX.setBounds(210, 130, 35, 28);
// btn7.addKeyListener(this);
try
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
SwingUtilities.updateComponentTreeUI(this);
catch (Exception e)
System.out.println("Could not load Metal Look and Feel");
public void keyReleased(KeyEvent e)
//btn1 = txtArea.getRegisteredKeyStrokes();
// System.out.println(1);
// keyTyped();
public void keyPressed(KeyEvent e)
//if (e.getActionCommand().equals("1"));
//(e.getKeyText().compareTo("1"));
//(e.getKeyCode().equals("1"));
//else
System.out.println("Error");
//keyTyped();
public void keyTyped(KeyEvent e)
//displayInfo(e, "KEY TYPED: ");
System.err.println("KeyTyped >>> " + e.KEY_TYPED);
//keyEvent.keyTyped();
// e.KEY_TYPED;
/* protected void displayInfo (KeyEvent e, string s)
{KeyCodeString;
int keyCode = e.getKeyCode();
keyCodeString = "key code " + keyCode
+ "("
+ KeyEvent.getKeyText(keyCode);
public void actionPerformed(ActionEvent e)
stringInput = e.getActionCommand();
System.out.println("First stringInput action performed>>" +stringInput);
System.out.println("First pre action performed>>" +pre);
if (stringInput == "C")
operand1 = "";
operand2 = "";
var1 = 0;
var2 = 0;
var1 = result;
txtArea.setText("0.");
flag = false;//to force the operations to jump to operand 1 and go through the loop as normal
pre = "";
if (stringInput == "CE")
operand2 = "";
var2 = 0;
txtArea.setText("0.");
flag = true;//to force the operations to jump to operand 1 and go through the loop as normal
if (stringInput == "MR")
if (var1 != 0)
txtArea.setText(Double.toString(var1));
mArea.setText("M");
System.err.println("mem@operand1 >> "+ mem );
else if (var2 != 0)
txtArea.setText(Double.toString(var2));
mArea.setText("M");
System.err.println("mem @ mR else>> "+ mem );
if (stringInput == "MS")
mArea.setText("M");
if (operand1 != "")
mem = var1;
else if (operand2 != "")
mem = var2;
else
mem = 0;
if (stringInput == "MC")
mArea.setText("");//to clear the text area display
mem = 0;//to reset the variable
if (stringInput == "M+")
mArea.setText("M");
flag = true;//to force the operations to jump to operand 2 and go through the loop as normal
if (stringInput == "=")
//result = evaluate();
txtArea.setText(Double.toString(result));
System.out.println("Equals>>" +stringInput);
System.out.println("Equals>>" +pre);
System.err.println("The flag at equals is " + flag);
if (stringInput == "+"||stringInput == "-"||stringInput == "/"||
stringInput == "*"||stringInput == "=")
pre = pre.concat(stringInput);
System.out.println("Second action perfo/check for operator>>" +stringInput);
System.out.println("Second pre action perfo/check for operator>>" +pre);
operand2 = "";
System.err.println("The flag at +,- etc is " + flag);
if(!flag &&(stringInput == "*"|| stringInput == "/"))
var2 = 1;
stringInput = "";
flag = true;
if(!flag)
stringInput = pre;
System.out.println("if flag true/stringInput" +stringInput);
System.out.println("flag true/pre" +pre);
else
//These statements extract the operator
stringInput = pre.valueOf(pre.charAt(pre.length()-2));
ch = pre.charAt(pre.length()-2);
System.out.println("@ position -2 stringInput" + pre.valueOf(pre.charAt(pre.length()-2)));
System.out.println("@ position -2 pre" + pre.charAt(pre.length()-2));
result = evaluate();
var2 = 0;
operand2 = "";
txtArea.setText(Double.toString(result));
System.out.println("Total is " + result);
flag = true;
if(!flag &&(stringInput == "*"|| stringInput == "/"))
var2 = 1;
stringInput = "";
flag = true;
if (stringInput == "%")
//evaluate();
txtArea.setText(Double.toString(result));
System.err.println("mem @ mR else>> "+ result + " %" );
if (stringInput == "1/x")
if (operand1 != "")
txtArea.setText(Double.toString(1/var1));
//System.err.println("mem@operand1 >> "+ mem );
else if (operand2 != "")
operand2 = "";
txtArea.setText(Double.toString(1/var2));
//System.err.println(">> "+ mem );
if (Character.isDigit(stringInput.charAt(0))||stringInput == ".")
System.out.println(operand1);
if (stringInput == "." && operand1 == "")
operand1 = "0";
System.out.print("fail op1");
if (stringInput == "." && operand2 == "")
System.out.print("fail op2");
operand2 = "0";
if (flag==false)
operand1 = operand1.concat(stringInput);
result = Double.parseDouble(operand1);
System.out.println("op1 =>" + operand1);
txtArea.setText(operand1);
//result = var1;
System.out.println("result after var1 = result " + result);
else
operand2 = operand2.concat(stringInput);
var2 = Double.parseDouble(operand2);
//var2 = vMod;
System.out.println("op2 =>" + operand2);
txtArea.setText(" ");//to clear the text area
txtArea.setText(operand2);//to display the second number if (operators == "+")
System.out.println("result after var2 " + result);
public double evaluate()
if (ch == '+' )
result = result + var2;
if (ch == '-' )
result = result - var2;
if (ch == '/' )
result = result / var2;
if (ch == '*' )
result = result * var2;
if (ch == '%')
var2 = Double.parseDouble(operand2);
result = result/vMod*100;
System.out.println("% "+ result);
return result;
public static void main(String [] args)
Calctester x = new Calctester();
} -
MBP late 2013 i7 2.3gHZ restart problems and major input lags
Since I've updated my MBP i7 2.3 Ghz late 2013 to OSX Yosemite (10.10.1) I can't restart the macbook with my promise harddrive and apple cinema display still connected via thunderbolt. When I restart it keeps hanging on the grey screen without the apple logo. When I unplug the thunderbolt and usb cable, hold down the power button and turn it back it everything is fine. Just the restart won't work.. Any ideas?
Further more, I receive major input lags in different programs. For example I use Final Cut Pro (10.1.3) a lot for my job. I use managed media library all stored on the promise harddrive via thunderbolt. The footage I use is raw of the SD card from a Nikon D800 (h2.64 mov), of course i let everything import first before editing. Though I get major input lags (0,5-1,5 sec) when pressing the spacebar to play for example. Ive used this workflow exactly the same on my previous MBP (17" late 2011 I think) without any lags.
Specs of my MBP:
MacBook Pro (Retina, 15-inch, Late 2013)
Processor 2,3 GHz Intel Core i7
Memory 16 GB 1600 MHz DDR3
Graphics NVIDIA GeForce GT 750M 2048 MB
Storage 512 GB SSD
Hope anyone can help me.Your original configuration is an HDD. Have you considered replacing it with an SSD. It helps quite a bit.
The current 2013 (and now the 2014) MBPs are excellent machines, and can run Bootcamp via native EFI (Win 8/8.1 - Win7 has some driver challenges), rather than the CSM-BIOS layer and you will get very good performance. I would recommend a 16GB MBP. If you do a lot of external display work, dual GPUs may work better for you.
I use the TB-to-FW for accessing external disks, not sound cards, but the storage works fine. This machine can support 8GB RAM, which may also be worth considering. -
Magic mouse is lag on Yosemite
My magic mouse is lag when macbook air mid 2013 was upgrade to Yosemite.
The mouse scrolling is sometimes slow but sometimes too fast on the safari page.
How to solve this is problem?I'm on a Mac mini (Late 2012) running Yosemite (10.10.1) and had a lot of lag with my Magic Mouse. The mouse cursor would work smoothly for about 15 seconds then lag for about the next 15 seconds and continue the process all day every day since upgrading to Yosemite. I did the PRAM reset twice but it did not help.
Fixed for me:
Disable Internet Sharing
I came across this by accident when I noticed that my mouse was working fine all of a sudden and I went to reenable my internet sharing then the mouse started lagging again. Disabled internet sharing and mouse lag issues stopped. I'm also running Little Snitch 3.5 and I'm not sure if its a factor in the issue but it's currently active and mouse is running great. Will leave my internet sharing setting off.
Hope this fix works for someone else. Good Luck! -
Hyper V mouse input not captured over RDC on Server 2012 Solved
Hi,
I am using Hyper V and can't click a button due to mouse input not capturing. I have read similar posts in this website and not found the answer yet. I am connecting to the server using RDC and running hyper-v there.
When my machine is running, I have checked in settings and all of my integration services are enabled. If I click Action and press Install Integration Services Setup Disk then it loads the disc but I don't know how to run that disk, or don't know if I have
to if the check boxes for all the install integration services are ticked.
When I physically go to my server and run the Hyper V from there, I don't get the "Mouse Input is not captured" message when I click in the virtual machine but even when I try and press the button nothing happens
Any help would be greatly appreciated,
Nick"OS is Windows Server 2012 Standard."
OS of the VM is Windows Server 2012? OS of the Hyper-V host is Windows Server 2012? That is, your whole environment is Windows Server 2012? Just making sure because it have seen it too often in these forums that after trying to validate
one thing after another, the person finally states something like, "I'm running Hyper-V in a VM on <somebody's> hypervisor, and my VMs are not working correctly in Hyper-V".
If your host and VM are both Windows Server 2012, then the Integration Services are built in. Windows Server 2012 actually has them as part of the OS.
What is the operating system from which you are trying to connect? Are you trying to connect directly to the VM, or are you first using RDP to connect to the Hyper-V and then using RDP to connect to the VM? I'm basically just trying to find out
your exact configuration so we have a better understanding of where we might concentrate.
.:|:.:|:. tim -
I'm looking to getting a new tv for my games but I don't like the input lag on flat screens I'm looking for a flat screen with the same input lag as the toshiba version 27A41 but I don't know what the input lag for this tv is can someone help????
You weren't being ignored; it's only been two days. Unfortunately, I don't have a solution for you. You might want to try contacting customer support at (800) 631-3811.
- Peter -
im planning on buying an led hdtv for my xbox 360.
But will there be input lag? the hdtv supports 720/1080i/1080p and so does the xbox 360, so there is no input lag, correct?in other words, can you confirm this?
"Modern game consoles such as the 360 or PS3 don't have this problem since they are all natively HDTV ready supporting 720p, however games in 480i need to be scaled up to 720p and the rendered on the TV, during this can cause a delay, and thus what you control can have a delay on reaction times, such as your character moving a split second later then the actual input itself. This is why there is Game Mode included on certain models of HDTV, to reduce this input lag."
Maybe you are looking for
-
Problem with printing multiple Embedded PDF in HTML page
I have a list of embedded pdf in a html page to be printed in particular order. Using following java script i am trying silently print the pdf one by one. <br /><br />var objectList=document.getElementsByTagName("object");<br /><br />for(i=0;i<object
-
Successful Read of XML File by Transforms Return Null
Hi: I'm starting out with a simple BPEL process: Read an XML file, transform two fields. write an XML file. Both the read and write operations use the same .xsd file. I am successful at creating, compiling, deploying, and executing the process. The o
-
Unable to convert the sender service PPG to an ALE logical system
Hello all, maybe anybody can help or give me further information. I have set up a scenario to send IDOC from a business system ( ERP ) to a business service ( EXT ). Receiver is a linux system so I use the FTP-FILE adapter as communication channel
-
I usually run 2 Firefox windows with about 5-7 tabs each. once in a while my first window gets "re-sized" to about 1 inch long in the upper left of my screen. Nothing I do will bring it back. I have to reboot, then I can re-size it manually. Also, th
-
Hi, Can some1 explain me how the SNP data is stored in the live cache. I know it's by series of order. But tell me is there any mapping involved in it? Thanks, Siva.