Spending good money on a new keyboard or mouse to replace hardware that still works might seem like the height of PC-fashion foolishness. But doing so might be the most cost-effective way to upgrade an aging PC (aside from adding more memory, which never goes out of style).

Keyboards and mice have improved a fair amount in the past few years. The latest models provide brisker mouse tracking, clever scrolling and program-switching options, robust keyboard multimedia controls, and hand-cuddling ergonomics. Most of them have USB and PS/2 connections and work in Windows and the Mac OS.

Sometimes, however, they bring the same annoyances as any other PC upgrade, as we found out while trying input devices from market leaders Logitech and Microsoft.

Logitech's MX300 mouse ($30) and Microsoft's Optical Mouse Blue ($35) use optical sensors instead of rolling balls; unlike their mechanical predecessors, they fly through tasks on imperfect surfaces and don't gunk up with crud. They also include scroll wheels for fast and accurate scrolling through Web pages and other documents.

Microsoft's blue mouse has the added advantage of ambidexterity, compared with the right-hand orientation of most mice. Logitech still does a better job of molding its devices so they gracefully fit the contours of a wide range of hands.

Higher-end mice add programmable buttons, which take time and practice to get used to but let you do things like flip back and forth in Web pages without taking your eyes off the screen. Less useful are gimmicks such as clear scroll wheels and color faceplates -- a red rodent won't make your beige box any more exciting.

The latest trend in mice is wireless, as in Microsoft's Wireless IntelliMouse Explorer ($65, USB only). Not having a mouse cord in the way can become quite appealing, although you do need to replace their batteries every so often. I've had to change the batteries in an older wireless mouse as often as every few months and as rarely as once a year.

Logitech's MX700 Cordless Optical Mouse ($80) includes a rechargeable battery that replenishes itself when you slide the mouse into a docking station. It includes a variety of specialized controls, such as a button that switches between open programs and documents.

Replacement keyboards from Microsoft and Logitech offer much better tactile feedback than the cheap hardware that comes with many new PCs, plus programmable buttons to control volume and playback of MP3s, CDs and DVDs. The Logitech Elite Keyboard ($50), for example, adds a volume knob and a scroll wheel.

But Microsoft's new line of keyboards, starting at $35 for its MultiMedia Keyboard, does even better by getting rid of a few keys. Microsoft has finally banished the evil Insert key, which routinely causes touch-typists to lose work when they accidentally hit this key and switch Windows into "overtype" mode. The benign but equally useless Scroll Lock key is also history.

Wireless keyboards are not as useful an upgrade as wireless mice, unless you like surfing from the couch. Both companies do, however, offer reasonably priced bundles of wireless keyboards and mice: Microsoft's Wireless Optical Desktop, at $85, and Logitech's Cordless Navigator Duo ($80) and Cordless Elite Duo ($100).

And then there's Microsoft's Wireless Optical Desktop for Bluetooth ($159, USB and Win XP only), which by its description should be the be-all, end-all of input devices. It uses wireless Bluetooth personal-networking technology to offer more range -- up to 30 feet, allowing you to operate your PC from so far away that you can't read the screen.

But it took more than half an hour to install, and its skimpy six-page printed manual lacks some essential information. A balky setup with multiple reboots is no way for peripherals to behave, especially a simple keyboard and mouse.

Clockwise from top left: Logitech's MX300 and MX700; Microsoft's Wireless IntelliMouse Explorer, Wireless Optical Desktop and MultiMedia Keyboard; Logitech's Elite Keyboard; and Microsoft's Optical Mouse Blue.