diff --git a/app/src/processing/app/EditorListener.java b/app/src/processing/app/EditorListener.java index 58c3fc9a1..12806b4ce 100644 --- a/app/src/processing/app/EditorListener.java +++ b/app/src/processing/app/EditorListener.java @@ -122,6 +122,14 @@ public class EditorListener { } } + if ((event.getModifiers() & KeyEvent.CTRL_MASK) != 0) { + // Consume ctrl-m(carriage return) keypresses + if (code == KeyEvent.VK_M) { + event.consume(); // does nothing + return false; + } + } + if ((event.getModifiers() & KeyEvent.META_MASK) != 0) { //event.consume(); // does nothing return false; diff --git a/app/src/processing/app/syntax/TextAreaPainter.java b/app/src/processing/app/syntax/TextAreaPainter.java index cc93aeded..e99329526 100644 --- a/app/src/processing/app/syntax/TextAreaPainter.java +++ b/app/src/processing/app/syntax/TextAreaPainter.java @@ -515,7 +515,10 @@ implements TabExpander, Printable */ public Dimension getMinimumSize() { - return getPreferredSize(); + Dimension dim = new Dimension(); + dim.width = fm.charWidth('w') * 10; + dim.height = fm.getHeight() * 4; + return dim; } // package-private members diff --git a/build/build.xml b/build/build.xml index bfee8f6d1..245a9a37a 100644 --- a/build/build.xml +++ b/build/build.xml @@ -354,10 +354,9 @@ - - - + + @@ -368,10 +367,9 @@ - - - + + diff --git a/build/shared/lib/keywords.txt b/build/shared/lib/keywords.txt index 74fb064e5..eb3bd4b09 100644 --- a/build/shared/lib/keywords.txt +++ b/build/shared/lib/keywords.txt @@ -31,6 +31,7 @@ byte KEYWORD1 Byte case KEYWORD1 SwitchCase char KEYWORD1 Char class KEYWORD1 +const KEYWORD1 Const continue KEYWORD1 Continue default KEYWORD1 SwitchCase do KEYWORD1 DoWhile diff --git a/build/windows/dist/drivers/Arduino USBSerial.inf b/build/windows/dist/drivers/Arduino USBSerial.inf new file mode 100644 index 000000000..f8553fbb9 --- /dev/null +++ b/build/windows/dist/drivers/Arduino USBSerial.inf @@ -0,0 +1,106 @@ +;************************************************************ +; Windows USB CDC ACM Setup File +; Copyright (c) 2000 Microsoft Corporation + + +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%MFGNAME% +LayoutFile=layout.inf +CatalogFile=%MFGFILENAME%.cat +DriverVer=11/15/2007,5.1.2600.0 + +[Manufacturer] +%MFGNAME%=DeviceList, NTamd64 + +[DestinationDirs] +DefaultDestDir=12 + + +;------------------------------------------------------------------------------ +; Windows 2000/XP/Vista-32bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.nt] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.nt +AddReg=DriverInstall.nt.AddReg + +[DriverCopyFiles.nt] +usbser.sys,,,0x20 + +[DriverInstall.nt.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.nt.Services] +AddService=usbser, 0x00000002, DriverService.nt + +[DriverService.nt] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + +;------------------------------------------------------------------------------ +; Vista-64bit Sections +;------------------------------------------------------------------------------ + +[DriverInstall.NTamd64] +include=mdmcpq.inf +CopyFiles=DriverCopyFiles.NTamd64 +AddReg=DriverInstall.NTamd64.AddReg + +[DriverCopyFiles.NTamd64] +%DRIVERFILENAME%.sys,,,0x20 + +[DriverInstall.NTamd64.AddReg] +HKR,,DevLoader,,*ntkern +HKR,,NTMPDriver,,%DRIVERFILENAME%.sys +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + +[DriverInstall.NTamd64.Services] +AddService=usbser, 0x00000002, DriverService.NTamd64 + +[DriverService.NTamd64] +DisplayName=%SERVICE% +ServiceType=1 +StartType=3 +ErrorControl=1 +ServiceBinary=%12%\%DRIVERFILENAME%.sys + + +;------------------------------------------------------------------------------ +; Vendor and Product ID Definitions +;------------------------------------------------------------------------------ +; When developing your USB device, the VID and PID used in the PC side +; application program and the firmware on the microcontroller must match. +; Modify the below line to use your VID and PID. Use the format as shown below. +; Note: One INF file can be used for multiple devices with different VID and PIDs. +; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line. +;------------------------------------------------------------------------------ +[SourceDisksFiles] +[SourceDisksNames] +[DeviceList] +%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_003B + +[DeviceList.NTamd64] +%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_003B + + +;------------------------------------------------------------------------------ +; String Definitions +;------------------------------------------------------------------------------ +;Modify these strings to customize your device +;------------------------------------------------------------------------------ +[Strings] +MFGFILENAME="CDC_vista" +DRIVERFILENAME ="usbser" +MFGNAME="Arduino LLC (www.arduino.cc)" +INSTDISK="Arduino USBSerial Driver Installer" +DESCRIPTION="Arduino UNO" +SERVICE="USB RS-232 Emulation Driver" \ No newline at end of file diff --git a/libraries/Ethernet/examples/ChatServer/ChatServer.ino b/libraries/Ethernet/examples/ChatServer/ChatServer.ino index 9f819fd5a..de7525769 100644 --- a/libraries/Ethernet/examples/ChatServer/ChatServer.ino +++ b/libraries/Ethernet/examples/ChatServer/ChatServer.ino @@ -12,7 +12,7 @@ created 18 Dec 2009 by David A. Mellis - modified 10 August 2010 + modified 12 March 2012 by Tom Igoe */ @@ -23,14 +23,16 @@ // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network. // gateway and subnet are optional: -byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; +byte mac[] = { + 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(192,168,1, 177); IPAddress gateway(192,168,1, 1); IPAddress subnet(255, 255, 0, 0); + // telnet defaults to port 23 EthernetServer server(23); -boolean gotAMessage = false; // whether or not you got a message from the client yet +boolean alreadyConnected = false; // whether or not the client was connected previously void setup() { // initialize the ethernet device @@ -39,25 +41,34 @@ void setup() { server.begin(); // open the serial port Serial.begin(9600); + Serial.print("Chat server address:"); + Serial.println(Ethernet.localIP()); } void loop() { // wait for a new client: EthernetClient client = server.available(); - + // when the client sends the first byte, say hello: if (client) { - if (!gotAMessage) { + if (!alreadyConnected) { + // clead out the input buffer: + client.flush(); Serial.println("We have a new client"); client.println("Hello, client!"); - gotAMessage = true; + alreadyConnected = true; + } + + if (client.available() > 0) { + // read the bytes incoming from the client: + char thisChar = client.read(); + // echo the bytes back to the client: + server.write(thisChar); + // echo the bytes to the server as well: + Serial.write(thisChar); } - - // read the bytes incoming from the client: - char thisChar = client.read(); - // echo the bytes back to the client: - server.write(thisChar); - // echo the bytes to the server as well: - Serial.print(thisChar); } } + + +